summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--UPGRADING4
-rw-r--r--sapi/cgi/cgi_main.c7
-rw-r--r--sapi/fpm/fpm/fpm_main.c5
4 files changed, 17 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 9c7323ac6f..49cc899370 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,10 @@ PHP NEWS
. Add property DOMXPath::$registerNodeNamespaces and constructor argument
that allow global flag to configure query() or evaluate() calls.
+- FPM:
+ . Fixed bug #64865 (Search for .user.ini files from script dir up to
+ CONTEXT_DOCUMENT_ROOT). (Will Bender)
+
- GD:
. Fixed bug #55005 (imagepolygon num_points requirement). (cmb)
. Replaced gd resources with objects. (Mark Randall)
diff --git a/UPGRADING b/UPGRADING
index 42e52a7cac..88241d9cc7 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -371,6 +371,10 @@ PHP 8.0 UPGRADE NOTES
3. Changes in SAPI modules
========================================
+- 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 3bd1d2d0d4..10f92d9fd3 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -913,9 +913,12 @@ static int sapi_cgi_activate(void)
if (fcgi_is_fastcgi()) {
fcgi_request *request = (fcgi_request*) SG(server_context);
- doc_root = FCGI_GETENV(request, "DOCUMENT_ROOT");
+ /* 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");
} else {
- doc_root = getenv("DOCUMENT_ROOT");
+ doc_root = getenv("CONTEXT_DOCUMENT_ROOT");
+ doc_root = doc_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 5a7d3cb320..d00c0c2795 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -733,7 +733,10 @@ 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)) {
- doc_root = FCGI_GETENV(request, "DOCUMENT_ROOT");
+ /* 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");
+
/* DOCUMENT_ROOT should also be defined at this stage..but better check it anyway */
if (doc_root) {
doc_root_len = strlen(doc_root);