Skip to content

Commit

Permalink
Revert "Fix bug #64865: Use CONTEXT_DOCUMENT_ROOT for scanning dir tree"
Browse files Browse the repository at this point in the history
This reverts commit 98bfad7.

This doesn't work well in some setups, see bug #80113 and GH-5051.
Reverting this for now.
  • Loading branch information
nikic committed Oct 19, 2020
1 parent 7727a02 commit c97da0f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
2 changes: 0 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,6 @@ PHP NEWS
. Use libenchant-2 when available.

- FPM:
. Fixed bug #64865 (Search for .user.ini files from script dir up to
CONTEXT_DOCUMENT_ROOT). (Will Bender)
. Add pm.status_listen option. (Jakub Zelenka)

- GD:
Expand Down
4 changes: 0 additions & 4 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -845,10 +845,6 @@ PHP 8.0 UPGRADE NOTES
- Apache:
. The PHP module has been renamed from php7_module to php_module.

- CGI and FPM will now use CONTEXT_DOCUMENT_ROOT to scan for .user.ini files,
if it is defined. Otherwise, DOCUMENT_ROOT will be used as before. This
improves support for Apache mod_userdir and mod_alias.

========================================
4. Deprecated Functionality
========================================
Expand Down
7 changes: 2 additions & 5 deletions sapi/cgi/cgi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -914,12 +914,9 @@ static int sapi_cgi_activate(void)
if (fcgi_is_fastcgi()) {
fcgi_request *request = (fcgi_request*) SG(server_context);

/* Prefer CONTEXT_DOCUMENT_ROOT if set */
doc_root = FCGI_GETENV(request, "CONTEXT_DOCUMENT_ROOT");
doc_root = doc_root ? doc_root : FCGI_GETENV(request, "DOCUMENT_ROOT");
doc_root = FCGI_GETENV(request, "DOCUMENT_ROOT");
} else {
doc_root = getenv("CONTEXT_DOCUMENT_ROOT");
doc_root = doc_root ? doc_root : getenv("DOCUMENT_ROOT");
doc_root = getenv("DOCUMENT_ROOT");
}
/* DOCUMENT_ROOT should also be defined at this stage..but better check it anyway */
if (doc_root) {
Expand Down
5 changes: 1 addition & 4 deletions sapi/fpm/fpm/fpm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,10 +729,7 @@ static int sapi_cgi_activate(void) /* {{{ */

/* Load and activate user ini files in path starting from DOCUMENT_ROOT */
if (PG(user_ini_filename) && *PG(user_ini_filename)) {
/* Prefer CONTEXT_DOCUMENT_ROOT if set */
doc_root = FCGI_GETENV(request, "CONTEXT_DOCUMENT_ROOT");
doc_root = doc_root ? doc_root : FCGI_GETENV(request, "DOCUMENT_ROOT");

doc_root = FCGI_GETENV(request, "DOCUMENT_ROOT");
/* DOCUMENT_ROOT should also be defined at this stage..but better check it anyway */
if (doc_root) {
doc_root_len = strlen(doc_root);
Expand Down

0 comments on commit c97da0f

Please sign in to comment.