Edit report at https://bugs.php.net/bug.php?id=50921&edit=1
ID: 50921
Comment by: http at sendspamhere dot com
Reported by: phpbug at starurl dot com
Summary: '200 OK' HTTP status despite PHP error
Status: Re-Opened
Type: Bug
Package: HTTP related
Operating System: *
PHP Version: 5.2.12
Block user comment: N
Private report: N
New Comment:
You can't completely fix this by the way http works.
<?php
echo 'x';
ob_flush(); // http status code and headers are now sent to client
eval('x=y'); // error detected here
no matter which technology stack, after you've sent everything is 200 OK you can't signal
the client something went wrong. You shouldn't monitor your service through status codes only
because of this edge case. Monitor your logs.
Previous Comments:
------------------------------------------------------------------------
[2015-11-29 21:32:21] anzenews at volja dot net
I can't believe this hasn't been solved yet. It has been more than 5 years people! RFC
2616 is very clear on proper HTTP status codes
(http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). If some obscure browser handles return
codes improperly, that should be solved there, not in PHP. This is not 1990s anymore, IE is far from
being a dominant browser anymore.
So how about fixing this the right way? Just return status 5xx on parsing and similar errors, as
recommended (SHOULD) by HTTP 1.1 protocol. It shouldn't be that difficult.
------------------------------------------------------------------------
[2015-11-29 06:28:37] admin at mcnaughton dot media
Not just display_errors = off. I believe this effects display_errors =
stderr as well for similar reasons.
------------------------------------------------------------------------
[2015-07-20 10:17:39] xmeltrut at gmail dot com
I would agree that this is a bug. If there has been a server error, we should not be returning a 200
response. If IE then does not display it, that is a problem for IE to look at. The wrong header
causes a lot of problems, especially for AJAX>
------------------------------------------------------------------------
[2015-05-25 17:33:23] josh dot ribakoff at gmail dot com
+1
This is a BUG in my books. Until it is fixed, I can't simply tail an error log. Instead
I'd have to go manually exercise every feature & invoke every code path in my app &
painstakingly analyze the network responses of all my ajax calls to detect any possible errors.
Horrible.
------------------------------------------------------------------------
[2014-07-09 23:00:27] yohgaki@php.net
See also
https://bugs.php.net/bug.php?id=61417
------------------------------------------------------------------------
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=50921
--
Edit this bug report at https://bugs.php.net/bug.php?id=50921&edit=1