diff options
author | Remi Collet <remi@php.net> | 2014-09-15 13:31:26 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2014-09-15 13:31:26 +0200 |
commit | 47bc380ecf2a222e7e0a41331f4b4a92a4c898ad (patch) | |
tree | 8e99022163ec8d33df5c8d24d1f207a371f8f7a8 /sapi | |
parent | 7f0f04e606a81be30a962fefa4ee40ae03e836a5 (diff) | |
parent | ad0b63cad4e372c6d063ec2d5df8782fd63de06a (diff) | |
download | php-git-47bc380ecf2a222e7e0a41331f4b4a92a4c898ad.tar.gz |
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
NEWS
Fixed bug #65641 PHP-FPM incorrectly defines the SCRIPT_NAME variable when using Apache
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/fpm/fpm/fpm_main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index cd5492d73d..5b96dee038 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -1237,6 +1237,17 @@ static void init_request_info(TSRMLS_D) SG(request_info).request_uri = orig_script_name; } path_info[0] = old; + } else if (apache_was_here && env_script_name) { + /* Using mod_proxy_fcgi and ProxyPass, apache cannot set PATH_INFO + * As we can extract PATH_INFO from PATH_TRANSLATED + * it is probably also in SCRIPT_NAME and need to be removed + */ + int snlen = strlen(env_script_name); + if (snlen>slen && !strcmp(env_script_name+snlen-slen, path_info)) { + _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC); + env_script_name[snlen-slen] = 0; + SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name TSRMLS_CC); + } } env_path_info = _sapi_cgibin_putenv("PATH_INFO", path_info TSRMLS_CC); } |