From c97da0f819730c00905f9618aba0c54e8d592f74 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 19 Oct 2020 11:22:32 +0200 Subject: Revert "Fix bug #64865: Use CONTEXT_DOCUMENT_ROOT for scanning dir tree" This reverts commit 98bfad738ad2734dfba5733323f7ba733daf3ec3. This doesn't work well in some setups, see bug #80113 and GH-5051. Reverting this for now. --- NEWS | 2 -- UPGRADING | 4 ---- sapi/cgi/cgi_main.c | 7 ++----- sapi/fpm/fpm/fpm_main.c | 5 +---- 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/NEWS b/NEWS index 481d67ddcb..736ae5e0a3 100644 --- a/NEWS +++ b/NEWS @@ -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: diff --git a/UPGRADING b/UPGRADING index a15feb826d..a32e8e2643 100644 --- a/UPGRADING +++ b/UPGRADING @@ -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 ======================================== diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 8048085ebe..d1d538345f 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -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) { diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 84b9e5958a..7c11b3af8a 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -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); -- cgit v1.2.1