php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66276 Missing HTTP headers on CORE_ERROR output of php.cgi
Submitted: 2013-12-12 15:23 UTC Modified: 2021-08-06 16:37 UTC
Votes:5
Avg. Score:4.4 ± 0.8
Reproduced:4 of 5 (80.0%)
Same Version:2 (50.0%)
Same OS:4 (100.0%)
From: dave at icdsoft dot com Assigned:
Status: Verified Package: CGI/CLI related
PHP Version: 7.4 OS: *
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-12-12 15:23 UTC] dave at icdsoft dot com
Description:
------------
The error handling of php54.cgi does not submit HTTP headers in some cases. This causes Internal Server Error 500 in Apache.

$ php54.cgi <test.php
<br />
<b>Fatal error</b>:  Directive 'magic_quotes_gpc' is no longer available in PHP in <b>Unknown</b> on line <b>0</b><br />

For other errors the headers are ok

$ php54.cgi <test.php
X-Powered-By: PHP/5.4.22
Content-type: text/html

<br />
<b>Parse error</b>:  syntax error, unexpected 'df' (T_STRING) in <b>-</b> on line <b>3</b><br />


Test script:
---------------
$ cat test.php
<?php
  phpinfo();  
?>

$ cat php.ini
register_globals = on


Expected result:
----------------
X-Powered-By: PHP/5.4.22
Content-type: text/html

<br />
<b>Fatal error</b>:  Directive 'magic_quotes_gpc' is no longer available in PHP in <b>Unknown</b> on line <b>0</b><br />

Actual result:
--------------
<br />
<b>Fatal error</b>:  Directive 'magic_quotes_gpc' is no longer available in PHP in <b>Unknown</b> on line <b>0</b><br />

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-12 19:23 UTC] aharvey@php.net
-Package: Apache related +Package: CGI/CLI related
 [2021-08-06 16:37 UTC] cmb@php.net
-Summary: Missing HTTP headers on CORE_ERROR output of php54.cgi +Summary: Missing HTTP headers on CORE_ERROR output of php.cgi -Status: Open +Status: Verified -Operating System: Linux +Operating System: * -PHP Version: 5.4.22 +PHP Version: 7.4
 [2021-08-06 16:37 UTC] cmb@php.net
I can confirm that this is still an issue with PHP-7.4 and most
likely PHP 8 as well.  I'm not sure whether this can be fixed
generally.  However, many fatal errors have already been converted
to Error exceptions, so this is less of an issue with current PHP
versions.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Oct 16 19:03:35 2021 UTC