php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #65641
Patch Another_fix_for_mod_proxy_fcgi_v2.patch revision 2014-09-15 09:13 UTC by remi@php.net
Patch Another_fix_for_mod_proxy_fcgi.patch revision 2014-09-05 13:14 UTC by remi@php.net
Patch fpm_main-script_name-v2.patch revision 2014-04-29 14:22 UTC by rainer dot jung at kippdata dot de
Patch fpm_main-script_name.patch revision 2014-04-29 14:12 UTC by rainer dot jung at kippdata dot de
Patch fix_script_name_in_fpm_with_apace_fixed revision 2014-03-16 17:03 UTC by ryotakatsuki at gmail dot com
Patch fix_script_name_in_fpm_with_apache revision 2013-09-09 09:13 UTC by ryotakatsuki at gmail dot com

Patch Another_fix_for_mod_proxy_fcgi_v2.patch for FPM related Bug #65641

Patch version 2014-09-15 09:13 UTC

Return to Bug #65641 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: remi@php.net

--- sapi/fpm/fpm/fpm_main.c.old	2014-09-15 10:19:13.910192543 +0200
+++ sapi/fpm/fpm/fpm_main.c	2014-09-15 10:48:25.238490219 +0200
@@ -1237,6 +1237,17 @@
 										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);
 							}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 18 01:01:28 2024 UTC