PHP 4.0 Bug #7722 Updated: script filename not passed to .cgi
| From: | tictactux at surfeu dot ch | Date: | Thu, 09 Nov 2000 22:41:08 +0000 |
| Subject: | PHP 4.0 Bug #7722 Updated: script filename not passed to .cgi | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-37619@lists.php.net to get a copy of this message | ||
ID: 7722
User Update by: tictactux@surfeu.ch
Old-Status: Open
Status: Closed
Bug Type: Other web server
Description: script filename not passed to .cgi
Issue closed, I said...
Previous Comments:
---------------------------------------------------------------------------
[2000-11-09 17:40:19] tictactux@surfeu.ch
Okay, got the bugger:
in sapi/cgi/cgi_main.c, function init_request_info I added
the following lines (marked by >>>)
if (!script_filename) {
>>> script_filename = getenv("SCRIPT_NAME");
>>> if (!script_filename)
script_filename = SG(request_info).argv();
}
so that my annoying server who does not ship SCRIPT_FILENAME still stands a valid chance...
If you think that the SCRIPT_NAME should be the last resort, then simply swap the assignments in the
outer if clause.
Issue closed. Unless someone forgets to put that into the source...
Regards, Ben
---------------------------------------------------------------------------
[2000-11-09 08:38:59] tictactux@surfeu.ch
When using php4.03pl1 as a .cgi (both from source or win32 binaries), the script filename is not
passed to php[.exe].
When I set the document root to /usr/local/www, then php complains that it was 'unable to open
/usr/local/www in unknown at line 0.'
When I set the document root to /usr/local/www/cgi-bin/test.php, then - miracle! - test.php is
loaded. (test.php will be loaded regardless of what other script I try to access, as I set the
doc_root to /usr/local/www/cgi-bin/test.php...)
Same both under Linux and WinNT. Seems that the script name is not appended to doc_root.
The SCRIPT_NAME variable is set correctly when I look at the phpinfo() output.
I set the display_startup_error to on; else I'd have the 'document contains no data'
error. The rest of the .ini (except from the doc_root entry) is as shipped.
Same stuff works fine with php 3.0.17.
Shouldn't PHP get the contents from the SCRIPT_NAME variable and add/mangle it to the doc_root
setting?
Regards, Ben
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7722