Patch fix_script_name_in_fpm_with_apache for FPM related Bug #65641
Patch version 2013-09-09 09:13 UTC
Return to Bug #65641 |
Download this patch
Patch Revisions:
Developer: ryotakatsuki@gmail.com
--- php/sapi/fpm/fpm/fpm_main.c.orig 2013-08-20 06:42:41.000000000 +0200
+++ php/sapi/fpm/fpm/fpm_main.c 2013-09-05 15:41:08.673158409 +0200
@@ -1050,6 +1050,8 @@
char *env_path_translated = sapi_cgibin_getenv("PATH_TRANSLATED", sizeof("PATH_TRANSLATED") - 1 TSRMLS_CC);
char *script_path_translated = env_script_filename;
char *ini;
+ char *fixed_script_name;
+ char *tmp_str;
int apache_was_here = 0;
/* some broken servers do not have script_filename or argv0
@@ -1206,6 +1231,14 @@
/* recall that PATH_INFO won't exist */
path_info = script_path_translated + ptlen;
tflag = (slen != 0 && (!orig_path_info || strcmp(orig_path_info, path_info) != 0));
+
+ if ((tmp_str = strstr(env_script_name, path_info)) && (strcmp(tmp_str, path_info) == 0 )) {
+ fixed_script_name = (char *) emalloc(strlen(env_script_name) - strlen(path_info));
+ strncpy ( fixed_script_name, env_script_name, strlen(env_script_name) - strlen(path_info));
+ fixed_script_name[strlen(env_script_name) - strlen(path_info)] = '\0';
+ orig_script_name = env_script_name;
+ env_script_name = fixed_script_name;
+ }
} else {
path_info = env_path_info ? env_path_info + pilen - slen : NULL;
tflag = (orig_path_info != path_info);
|