#28227 [NEW]: PHP CGI depends upon non-standard SCRIPT_FILENAME
| From: | lukem at NetBSD dot org | Date: | Fri, 30 Apr 2004 00:11:49 +0000 |
| Subject: | #28227 [NEW]: PHP CGI depends upon non-standard SCRIPT_FILENAME | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-59042@lists.php.net to get a copy of this message | ||
From: lukem at NetBSD dot org
Operating system: NetBSD 2.0C
PHP version: 4.3.6
PHP Bug Type: CGI related
Bug description: PHP CGI depends upon non-standard SCRIPT_FILENAME
Description:
------------
I upgraded PHP from 4.2.3 to 4.3.6 and I started getting the error "No
input file specified." from the php-as-cgi whilst running under a (fairly
minimal and small) web server called bozohttpd.
Further investigation reveals that
sapi/cgi/cgi_main.c::init_request_info() is using the existance of
SCRIPT_FILENAME to determine if php is running as a CGI.
However, the "defacto standard" for CGI/1.1:
http://cgi-spec.golux.com/
makes no mention of SCRIPT_FILENAME, only SCRIPT_NAME.
Thus, when a web server that is used to run php as a CGI doesn't support
SCRIPT_FILENAME (which is reasonable - see the specs above), php refuses
to function and fails with the error above.
Some research into other web servers indicates that none of them support
SCRIPT_FILENAME. These servers include:
thttpd, mini_httpd, w3c-httpd, OmniHTTPd - (PHP PR 25833), Xitami (PHP
PR 25305)
This issue is also alluded to in the "command line" documentation on your
web site:
http://www.php.net/features.commandline
(search for "no input file").
In summary, PHP 4.3.6 should not be relying solely upon SCRIPT_FILENAME to
determine if it's running as a CGI.
I have a patch to fix this issue - rev 1.10 of NetBSD's
pkgsrc/www/php4/patches/patch-aa - which I can provide if necessary.
Cheers,
Luke Mewburn.
--
Edit bug report at http://bugs.php.net/?id=28227&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28227&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28227&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28227&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28227&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28227&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28227&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28227&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28227&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28227&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28227&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28227&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28227&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28227&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28227&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28227&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28227&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28227&r=float