ID:               28227
 Comment by:       shane at caraveo dot com
 Reported By:      lukem at NetBSD dot org
 Status:           Assigned
 Bug Type:         CGI related
 Operating System: NetBSD 2.0C
 PHP Version:      4.3.6
 Assigned To:      shane
 New Comment:

The current code does not rely on script_filename, script_filename is
only used as a shortcut if it is available.  Otherwise, the init
function tries to determine the real script path, IF the fix_pathinfo
ini setting is on.  The current code was only tested under apache and
iis.

That said, the patch looks ok, and very likely improves the situation,
but needs some good testing on apache/mod_php, apache/cgi, iis/isapi
and iis/cgi, with various changes of configuration in php.ini (discard
path, fix pathinfo, etc.).  Unfortunately I have zero time.

-Shane


Previous Comments:
------------------------------------------------------------------------

[2004-05-03 11:59:41] [EMAIL PROTECTED]

Shane, can you please take a look when you have a moment?

------------------------------------------------------------------------

[2004-05-03 04:25:48] lukem at NetBSD dot org

Here's the patch:
 
http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/pkgsrc/www/php4/patches/patch-aa?rev=1.10&content-type=text/plain

------------------------------------------------------------------------

[2004-04-30 02:11:47] lukem at NetBSD dot org

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 this bug report at http://bugs.php.net/?id=28227&edit=1

Reply via email to