|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65917 getallheaders() is not supported by the built-in web server
Submitted: 2013-10-16 16:47 UTC Modified: 2013-11-18 22:06 UTC
From: ajf at ajf dot me Assigned: ajf (profile)
Status: Closed Package: Built-in web server
PHP Version: 5.4.20 OS: Windows, Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ajf at ajf dot me
New email:
PHP Version: OS:


 [2013-10-16 16:47 UTC] ajf at ajf dot me
The built-in CLI web server does not support getallheaders(). Given that projects may need to support headers unavailable in $_SERVER and that both Apache and FastCGI support it, it is unfortunate that the CLI web server does not.

I expect this would not be difficult to implement, considering that the CLI web server likely already has this information at its disposal.

Test script:
// The header() is just so that var_dump()'s output looks good in browser
// I'm aware that getallheaders() gets *request* headers
header('Content-Type: text/plain');

Expected result:
array(0) {

Actual result:
<br />
<b>Fatal error</b>:  Call to undefined function getallheaders() in <b>D:\Projects\test.php</b> on line <b>3</b><br />


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-17 18:48 UTC] ajf at ajf dot me
I'm extending this request to include apache_response_headers() as well as apache_request_headers() (which getallheaders() is but an alias of).
 [2013-11-18 22:06 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: ajf
 [2013-11-18 22:06 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 23 02:01:28 2024 UTC