From:             plcplc at gmail dot com
Operating system: Debian Linux
PHP version:      5.2.6
PHP Bug Type:     *Web Server problem
Bug description:  E_FATAL, E_ERROR should result in HTTP 500

Description:
------------
Currently PHP doesn't tamper with the HTTP error code at all.

It would be nice if errors could trigger the 500 Internal Server Error,
because it seems semantically correct.

Also, it would enable programs parsing output (e.g. an AJAX client) to
easily identify failure on the server, rather than starting to parse the
output to find an error suddenly occuring in the output.

The XMLHttpRequest function commonly used today actually supports calling
a user designated function upon HTTP-response codes different from the
usual 200 OK, which is why it would be nice to have PHP actually report the
error.

Of course, it's not possible to change the header once the headers have
been sent, but in many cases they haven't.

Reproduce code:
---------------
foo(); // call an undefined function

Expected result:
----------------
HTTP/1.1 500 Internal Server Error

Actual result:
--------------
HTTP1/1 200 OK

-- 
Edit bug report at http://bugs.php.net/?id=46510&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=46510&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=46510&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=46510&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=46510&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46510&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=46510&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=46510&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=46510&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=46510&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=46510&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=46510&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=46510&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=46510&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=46510&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=46510&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=46510&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=46510&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=46510&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=46510&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=46510&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=46510&r=mysqlcfg

Reply via email to