Re: PHP 4.0 Bug #5181 Updated: 'No input file specified' error in CGI mode / location of bugs in code
| From: | Patrick Doyle | Date: | Thu, 18 Jan 2001 17:24:09 +0000 |
| Subject: | Re: PHP 4.0 Bug #5181 Updated: 'No input file specified' error in CGI mode / location of bugs in code | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-44498@lists.php.net to get a copy of this message | ||
Yes, it appears to work now, thanks!
- Patrick Doyle
Bug Database wrote:
>
> ID: 5181
> Updated by: sniper
> Reported By: pdoyle@cncx.com
> Old-Status: Suspended
> Status: Closed
> Old-Bug Type: Installation problem
> Bug Type: *General Issues
> Assigned To:
> Comments:
>
> This should be fixed now. Please try PHP 4.0.4pl1.
>
> --Jani
>
> Previous Comments:
> ---------------------------------------------------------------------------
>
> [2000-08-02 12:13:24] hholzgra@php.net
> please wait, none of the suggested changes
> seem to be applied ... lets just suspend it for now
>
> ---------------------------------------------------------------------------
>
> [2000-08-01 22:59:35] waldschrott@php.net
> no feedback, closed
>
> ---------------------------------------------------------------------------
>
> [2000-06-28 05:06:55] stas@cvs.php.net
> Please chekc the latest version - does it work now?
>
> ---------------------------------------------------------------------------
>
> [2000-06-21 23:09:29] pdoyle@cncx.com
> As others have reported, setting --enable-discard-path does not allow PHP to run properly in
> CGI mode. This simple script will fail when hit through a Web server:
>
> #!/usr/local/bin/php
>
> <?php echo "Hello, world."; ?>
>
> producing a "No input file specified" error.
>
> There seem to be three bugs in the file sapi/cgi/cgi_main.c that cause this. (At least, when I
> fixed these things, it worked). I'll now reveal what is probably my ignorance of the code by
> pointing them out.
>
> The problems are all in the init_request_info() function. Specifically,
>
> 1. ~Line 252. script_filename is set to getenv("SCRIPT_FILENAME") rather than
> getenv("SCRIPT_NAME"). Maybe SCRIPT_FILENAME is a newer variant I haven't heard of,
> but our servers have always used SCRIPT_NAME.
>
> 2. ~Line 278. If DISCARD_PATH is set and script_filename is available,
> SG(request_info).path_translated should be set to the concatenation of
> getenv("DOCUMENT_ROOT") and script_filename, not just script_filename. Otherwise, when
> php_fopen_primary_script() tries to open it it will bomb, because it doesn't have the full
> path.
>
> 3. ~Line 290. For some reason, irrespective of the previous DISCARD_PATH section,
> SG(request_info).path_translated is set to NULL. This will clobber the script name when discard
> path is enabled. As far as I can tell this line should simply be removed.
>
> Hope that's useful to someone. :)
>
> ---------------------------------------------------------------------------
>
> Full Bug description available at: http://bugs.php.net/?id=5181