Bug #13035 Updated: 404 on a .php results in SERVER ERROR when using php as a cgi
| From: | sniper@php.net | Date: | Thu, 13 Jun 2002 22:04:46 +0000 |
| Subject: | Bug #13035 Updated: 404 on a .php results in SERVER ERROR when using php as a cgi | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-10402@lists.php.net to get a copy of this message | ||
ID: 13035
Updated by: sniper@php.net
Reported By: sbeam@ne.mediaone.net
-Status: Open
+Status: Bogus
Bug Type: Apache related
Operating System: Linux 2.4.6
PHP Version: 4.0.6
New Comment:
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2002-03-26 18:50:25] morissette@dmsolutions.ca
This problem has been annoying me for a while and is still present in
4.1.2 (CGI) at least. I stepped through the code in a debugger and
found out that when the php script doesn't exist then zend_error() is
called at the lower-level, but the zend_catch in cgi_main.c catches the
error and the php execution ends without any HTTP headers or
anything... hence the '500 Server Error'.
I don't know enough about the way Zend works to propose a patch, but I
found a nice WORKAROUND... in your php.ini, set
log_errors=On;
This way, the error message will be sent to your Apache error_log, and
the php execution will end nicely with proper HTTP headers, but an
empty document, which is better than a 500 server error.
------------------------------------------------------------------------
[2002-03-07 14:26:29] jamie-php@hungry.com
Yes with PHP 4.1.2 the problem occures still for me.
------------------------------------------------------------------------
[2002-01-17 19:32:26] sbeam@ne.mediaone.net
I dont know. I dont have 4.1.1 compiled as a CGI anywhere, won't have
time to do it and test it until next week probably.
------------------------------------------------------------------------
[2002-01-12 14:46:54] lobbin@php.net
Is still still valid with latest apache and php?
------------------------------------------------------------------------
[2001-08-29 12:12:13] sbeam@ne.mediaone.net
If PHP is used as a CGI program via:
Action php-script /cgi-bin/php
AddHandler php-script .php .php3
any .php page which is not found results in 500 SERVER ERROR in the
browser instead of 404 NOT FOUND. The php binary is returning nothing
in its response to this situation.
To wit:
The Apache error_log reports "Premature end of script headers"
The script_log (enabled with Apache's ScriptLog directive) reports:
%% [Wed Aug 29 12:09:58 2001] GET /cgi-bin/php/nothere.php HTTP/1.0
%% 500 /usr/local/httpd/cgi-bin/php
%request
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png,
*/*
Accept-Charset: iso-8859-1,*,utf-8
Accept-Encoding: gzip
Accept-Language: en
Connection: Keep-Alive
Host: localhost
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.6 i686)
%response
###
php was compiled with "'./configure' '--with-mysql=/usr'
'--with-gd'
'--with-imagick'
'--enable-discard-path' '--enable-force-cgi-redirect'"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=13035&edit=1