Bug 5181: No input file specified' error in CGI mode / location of bugs in code
| From: | Yury Bokhoncovich | Date: | Thu, 03 Aug 2000 11:13:17 +0000 |
| Subject: | Bug 5181: No input file specified' error in CGI mode / location of bugs in code | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-27538@lists.php.net to get a copy of this message | ||
Hi!
I think the problem is lying elsewhere than it was described.
Look, this is typical CGI call for Apache 1.2 and 1.3 (essentially,
irrelevant stuff snipped):
SERVER_SOFTWARE = Apache/1.2.5<BR>
GATEWAY_INTERFACE = CGI/1.1<BR>
DOCUMENT_ROOT = /usr/local/www/data<BR>
SERVER_PROTOCOL = HTTP/1.0<BR>
REQUEST_METHOD = GET<BR>
REMOTE_HOST = ic.fis.nsk.su<BR>
QUERY_STRING = <BR>
HTTP_USER_AGENT = Lynx/2.8.2dev.14 libwww-FM/2.14<BR>
...
SCRIPT_NAME = /cgi-bin/printenv<BR>
SCRIPT_FILENAME = /usr/local/www/cgi-bin/printenv<BR>
...
REQUEST_URI = /cgi-bin/printenv<BR>
SERVER_PORT = 80<BR>
...
There're neither PATH_INFO nor PATH_TRANSLATED although CGI-script is
fully functional.
Walking thru Apache sources shows that those ain't really in use.
Instead, SCRIPT_NAME and SCRIPT_FILENAME are set in every CGI-call.
Maybe Rows 629-633:
#if DISCARD_PATH
SG(request_info).path_translated =
estrdup(getenv("SCRIPT_FILENAME"));
#else
SG(request_info).path_translated =
estrdup(getenv("PATH_TRANSLATED"));
#endif
should be:
#if DISCARD_PATH
SG(request_info).path_translated =
estrdup(getenv("SCRIPT_FILENAME"));
#else
SG(request_info).path_translated=estrdup(strcat(getenv("DOCUMENT_ROOT"),getenv("SCRIPT_NAME")));
#endif
And yet, Row 311:
SG(request_info).request_uri = getenv("PATH_INFO");
Maybe, there should be:
SG(request_info).request_uri = getenv("REQUEST_URI");
--
WBR, Yury Bokhoncovich,
SysAdmin at FIS.
voice call: +7 (3832) 119727 pager: +7 (3832) 186555/61621
mailto: byg@fis.ru visit us: http://www.fis.ru/