php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #43621 Errors should provide HTTP 500 response
Submitted: 2007-12-18 10:05 UTC Modified: 2008-01-01 14:29 UTC
From: phillip dot oldham at gmail dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.5 OS: All
Private report: No CVE-ID: None
 [2007-12-18 10:05 UTC] phillip dot oldham at gmail dot com
Description:
------------
When using PHP with a webserver, errors raised which are above E_WARNING should produce a HTTP 500 response which can then be captured by the webserver and handled accordingly.

Reproduce code:
---------------
<?php
echlo "Hello World"
?>

Expected result:
----------------
HTTP/1.x 500 Internal Server Error 
Content-type: text/html; charset=utf-8
PHP Parse error:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/error.php on line 2

<br />
<b>Parse error</b>:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in <b>/var/www/error.php</b> on line <b>2</b><br />

Actual result:
--------------
PHP Parse error:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/error.php on line 2
Content-type: text/html; charset=utf-8

<br />
<b>Parse error</b>:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in <b>/var/www/error.php</b> on line <b>2</b><br />

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-01 14:29 UTC] magnus@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Bug #41342
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Aug 15 19:00:03 2025 UTC