Skip to content

Commit c97da0f

Browse files
committed
Revert "Fix bug #64865: Use CONTEXT_DOCUMENT_ROOT for scanning dir tree"
This reverts commit 98bfad7. This doesn't work well in some setups, see bug #80113 and GH-5051. Reverting this for now.
1 parent 7727a02 commit c97da0f

File tree

4 files changed

+3
-15
lines changed

4 files changed

+3
-15
lines changed

NEWS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,6 @@ PHP NEWS
239239
. Use libenchant-2 when available.
240240

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

246244
- GD:

UPGRADING

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -845,10 +845,6 @@ PHP 8.0 UPGRADE NOTES
845845
- Apache:
846846
. The PHP module has been renamed from php7_module to php_module.
847847

848-
- CGI and FPM will now use CONTEXT_DOCUMENT_ROOT to scan for .user.ini files,
849-
if it is defined. Otherwise, DOCUMENT_ROOT will be used as before. This
850-
improves support for Apache mod_userdir and mod_alias.
851-
852848
========================================
853849
4. Deprecated Functionality
854850
========================================

sapi/cgi/cgi_main.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -914,12 +914,9 @@ static int sapi_cgi_activate(void)
914914
if (fcgi_is_fastcgi()) {
915915
fcgi_request *request = (fcgi_request*) SG(server_context);
916916

917-
/* Prefer CONTEXT_DOCUMENT_ROOT if set */
918-
doc_root = FCGI_GETENV(request, "CONTEXT_DOCUMENT_ROOT");
919-
doc_root = doc_root ? doc_root : FCGI_GETENV(request, "DOCUMENT_ROOT");
917+
doc_root = FCGI_GETENV(request, "DOCUMENT_ROOT");
920918
} else {
921-
doc_root = getenv("CONTEXT_DOCUMENT_ROOT");
922-
doc_root = doc_root ? doc_root : getenv("DOCUMENT_ROOT");
919+
doc_root = getenv("DOCUMENT_ROOT");
923920
}
924921
/* DOCUMENT_ROOT should also be defined at this stage..but better check it anyway */
925922
if (doc_root) {

sapi/fpm/fpm/fpm_main.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -729,10 +729,7 @@ static int sapi_cgi_activate(void) /* {{{ */
729729

730730
/* Load and activate user ini files in path starting from DOCUMENT_ROOT */
731731
if (PG(user_ini_filename) && *PG(user_ini_filename)) {
732-
/* Prefer CONTEXT_DOCUMENT_ROOT if set */
733-
doc_root = FCGI_GETENV(request, "CONTEXT_DOCUMENT_ROOT");
734-
doc_root = doc_root ? doc_root : FCGI_GETENV(request, "DOCUMENT_ROOT");
735-
732+
doc_root = FCGI_GETENV(request, "DOCUMENT_ROOT");
736733
/* DOCUMENT_ROOT should also be defined at this stage..but better check it anyway */
737734
if (doc_root) {
738735
doc_root_len = strlen(doc_root);

0 commit comments

Comments
 (0)