Bug #50921 [Com]: '200 OK' HTTP status despite PHP error X-PHP-Bug: 50921 X-PHP-Site: PHP X-PHP-Type: Bug X-PHP-Version: 5.2.12 X-PHP-Category: HTTP
related X-PHP-OS: * X-PHP-Status: Re-Opened X-PHP-Old-Status: Re-Opened In-Reply-To: <bug-50921@bugs.php.net>
| From: | david at ols dot es" X-PHP-Bug : 50921X-PHP-Site : PHPX-PHP-Type : BugX-PHP-Version : 5 . 2 . 12X-PHP-Category : HTTP relatedX-PHP-OS : *X-PHP-Status : Re-OpenedX-PHP-Old-Status : Re-OpenedIn-Reply-To : | Date: | Fri, 17 Nov 2023 10:49:48 +0000 |
| Subject: | Bug #50921 [Com]: '200 OK' HTTP status despite PHP error X-PHP-Bug: 50921 X-PHP-Site: PHP X-PHP-Type: Bug X-PHP-Version: 5.2.12 X-PHP-Category: HTTP related X-PHP-OS: * X-PHP-Status: Re-Opened X-PHP-Old-Status: Re-Opened In-Reply-To: <bug-50921@bugs.php.net> |
||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245824@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=50921&edit=1
ID: 50921
Comment by: david at ols dot es
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:
in php 8.2 it returns a 200 response code even if using header and http_response_code
<?php
register_shutdown_function('shutdown_handler');
echo "Hello";
while(true) $data .= str_repeat('#', PHP_INT_MAX);
function shutdown_handler()
{
header($_SERVER['SERVER_PROTOCOL'].' 500 Internal Server Error', true, 500);
http_response_code(500);
print_r(error_get_last());
}
Previous Comments:
------------------------------------------------------------------------
[2019-04-24 21:56:00] danny dot boisvert at cogecomedia dot com
Just so you know, I had this same issue and I had to change my "error_reporting" value to
the resolved integer value
("E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED" -> 30711)
[Based on this: https://www.php.net/manual/en/errorfunc.constants.php]
since I'm trying to use an environment variable within the configuration file and it
doesn't seem to resolve the constants properly.
------------------------------------------------------------------------
[2018-07-10 15:07:20] drew+bug dot php dot net at mcdruid dot co dot uk
Note that this may sometimes be down to the CustomLog format in apache. For example
'%>s' can (correctly) yield a 403 in the access log whereas just '%s' may
record a 200 even when the status code of the response was something else.
------------------------------------------------------------------------
[2018-05-25 02:51:50] robberphex at gmail dot com
I'm trying to fix this.
Please review https://github.com/php/php-src/pull/3244.
And, Xdebug have same bug. If you are interested, see https://github.com/xdebug/xdebug/pull/420
------------------------------------------------------------------------
[2018-05-05 18:01:18] requinix@php.net
Related To: Bug #36636
------------------------------------------------------------------------
[2017-11-06 21:19:46] chealer at gmail dot com
I still experience this with XAMPP 5.6.30's PHP 5.6.30.
------------------------------------------------------------------------
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