summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2014-08-28 23:11:08 -0700
committerStanislav Malyshev <stas@php.net>2014-08-28 23:11:55 -0700
commite55c641792df2caf813b5df3272144974e4d8fc7 (patch)
tree177ae3952b0f1d5457961353ab57da4cb4712ccd
parentb38ca3adeeee502d2fb1be9b8956c60a3d7c1f0e (diff)
parentb206b0e29d2cf9a41b94befedfefd806a71d0846 (diff)
downloadphp-git-e55c641792df2caf813b5df3272144974e4d8fc7.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: fix NEWS for fcgi fix merge restore FPM compatibility with mod_fastcgi broken since #694 / 67541, fixes bug 67606
-rw-r--r--NEWS4
-rw-r--r--sapi/fpm/fpm/fpm_main.c11
2 files changed, 12 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index ad114007e9..459ecf8e1a 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,10 @@ PHP NEWS
. Fixed bug #41577 (DOTNET is successful once per server run)
(Aidas Kasparas)
+- FPM:
+ . Fixed #65641 (PHP-FPM incorrectly defines the SCRIPT_NAME variable when
+ using Apache). (David Zuelke)
+
- OpenSSL:
. Fixed bug #41631 (socket timeouts not honored in blocking SSL reads).
(Daniel Lowrey)
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index e8793259b4..56a06f90ee 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1142,13 +1142,16 @@ static void init_request_info(TSRMLS_D)
TRANSLATE_SLASHES(env_document_root);
}
- if (env_path_translated != NULL && env_redirect_url != NULL &&
+ if (!apache_was_here && env_path_translated != NULL && env_redirect_url != NULL &&
env_path_translated != script_path_translated &&
strcmp(env_path_translated, script_path_translated) != 0) {
/*
* pretty much apache specific. If we have a redirect_url
* then our script_filename and script_name point to the
* php executable
+ * we don't want to do this for the new mod_proxy_fcgi approach,
+ * where redirect_url may also exist but the below will break
+ * with rewrites to PATH_INFO, hence the !apache_was_here check
*/
script_path_translated = env_path_translated;
/* we correct SCRIPT_NAME now in case we don't have PATH_INFO */
@@ -1323,7 +1326,7 @@ static void init_request_info(TSRMLS_D)
efree(pt);
}
} else {
- /* make sure path_info/translated are empty */
+ /* make sure original values are remembered in ORIG_ copies if we've changed them */
if (!orig_script_filename ||
(script_path_translated != orig_script_filename &&
strcmp(script_path_translated, orig_script_filename) != 0)) {
@@ -1332,7 +1335,9 @@ static void init_request_info(TSRMLS_D)
}
script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", script_path_translated TSRMLS_CC);
}
- if (env_redirect_url) {
+ if (!apache_was_here && env_redirect_url) {
+ /* if we used PATH_TRANSLATED to work around Apache mod_fastcgi (but not mod_proxy_fcgi,
+ * hence !apache_was_here) weirdness, strip info accordingly */
if (orig_path_info) {
_sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info TSRMLS_CC);
_sapi_cgibin_putenv("PATH_INFO", NULL TSRMLS_CC);