diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-09-01 09:38:32 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-09-01 09:38:32 +0000 |
commit | 56c58a5402dce20c09b5bc0d8006f34b62dbc932 (patch) | |
tree | d37862b158a16824edc9e580ee9f0ed8eb58342d | |
parent | 8c78aab0ce54366749ac1ca50cfdcfeb57b377fe (diff) | |
download | busybox-w32-56c58a5402dce20c09b5bc0d8006f34b62dbc932.tar.gz busybox-w32-56c58a5402dce20c09b5bc0d8006f34b62dbc932.tar.bz2 busybox-w32-56c58a5402dce20c09b5bc0d8006f34b62dbc932.zip |
Tracking system but #4: php needs the environment variable SCRIPT_FILENAME.
git-svn-id: svn://busybox.net/trunk/busybox@11309 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | networking/httpd.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index e3f4027dc..191a316a1 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -1146,6 +1146,11 @@ static int sendCgi(const char *url, | |||
1146 | } | 1146 | } |
1147 | if(script != NULL) | 1147 | if(script != NULL) |
1148 | *script = '\0'; /* reduce /PATH_INFO */ | 1148 | *script = '\0'; /* reduce /PATH_INFO */ |
1149 | /* SCRIPT_FILENAME required by PHP in CGI mode */ | ||
1150 | if(realpath(purl + 1, realpath_buff)) | ||
1151 | addEnv("SCRIPT", "FILENAME", realpath_buff); | ||
1152 | else | ||
1153 | *realpath_buff = 0; | ||
1149 | /* set SCRIPT_NAME as full path: /cgi-bin/dirs/script.cgi */ | 1154 | /* set SCRIPT_NAME as full path: /cgi-bin/dirs/script.cgi */ |
1150 | addEnv("SCRIPT_NAME", "", purl); | 1155 | addEnv("SCRIPT_NAME", "", purl); |
1151 | addEnv("QUERY_STRING", "", config->query); | 1156 | addEnv("QUERY_STRING", "", config->query); |
@@ -1178,7 +1183,7 @@ static int sendCgi(const char *url, | |||
1178 | /* set execve argp[0] without path */ | 1183 | /* set execve argp[0] without path */ |
1179 | argp[0] = strrchr( purl, '/' ) + 1; | 1184 | argp[0] = strrchr( purl, '/' ) + 1; |
1180 | /* but script argp[0] must have absolute path and chdiring to this */ | 1185 | /* but script argp[0] must have absolute path and chdiring to this */ |
1181 | if(realpath(purl + 1, realpath_buff) != NULL) { | 1186 | if(*realpath_buff) { |
1182 | script = strrchr(realpath_buff, '/'); | 1187 | script = strrchr(realpath_buff, '/'); |
1183 | if(script) { | 1188 | if(script) { |
1184 | *script = '\0'; | 1189 | *script = '\0'; |