Req #41342 [Nab]: PHP says syntax errors are 200 OK
| From: | tyrael@php.net | Date: | Fri, 08 Aug 2014 13:13:21 +0000 |
| Subject: | Req #41342 [Nab]: PHP says syntax errors are 200 OK | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-187024@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=41342&edit=1
ID: 41342
Updated by: tyrael@php.net
Reported by: defenestrator at gmail dot com
Summary: PHP says syntax errors are 200 OK
Status: Not a bug
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: FreeBSD
PHP Version: 5.2.2
Block user comment: N
Private report: N
New Comment:
duplicate of https://bugs.php.net/bug.php?id=50921
please check out the discussion and the reasoning for the current behavior there.
Previous Comments:
------------------------------------------------------------------------
[2014-08-08 12:59:42] bjoerndietz at gmx dot de
I'm not sure if this is good practise or not, but many php-based webservices use the HTTP
response codes to declare if the process invoked has been successful or not. For those it can be a
painful experience looking for a possible error behaviour while only dealing with the 200 response
(yes, the clients should look at the additional data returned if there are any).
Therefore there should be some way to configure the HTTP response code for these situations.
I'd expect a 500 error, too.
------------------------------------------------------------------------
[2010-02-08 02:36:16] defenestrator at gmail dot com
Having display_errors off should not be part of the correct conditions. I have display_errors on in
my development environment, and I want a 500 code in that situation. Getting a 200 code causes
errors to be cached, and if there's such an error in an AJAX request, then it can't be
easily refreshed in some browsers. I have to test things in a lot of browsers, so it would be great
if I could get a 500 here.
------------------------------------------------------------------------
[2010-02-03 10:04:23] jani@php.net
Already happens in correct conditions. (display_errors off, headers not sent by the time error
happens and if status was 200 before the error)
------------------------------------------------------------------------
[2009-08-27 11:55:16] steffen at steffen-gebert dot de
I have display_errors off and I also get code 200 (on syntax errors, undefined functions, ..).
Please.. really sent 500 here!
------------------------------------------------------------------------
[2009-03-17 18:45:53] php at plummer dot us
I just want to be able to notify people of errors. With syntax errors, I can't use php code to
do so and the web server doesn't know there's been a problem when a 200 response is
returned so I can't use its error reporting capabilities. Basically it violates the http rfc to
return a 200 on an error response.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=41342
--
Edit this bug report at https://bugs.php.net/bug.php?id=41342&edit=1