|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #17204 getallheaders() not available in all SAPIs
Submitted: 2002-05-14 07:47 UTC Modified: 2017-10-20 17:58 UTC
Avg. Score:3.0 ± 2.0
Reproduced:0 of 1 (0.0%)
From: phpuser at infomediaire dot be Assigned: kalle (profile)
Status: Closed Package: *Web Server problem
PHP Version: 5.6.0 OS: NT
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: phpuser at infomediaire dot be
New email:
PHP Version: OS:


 [2002-05-14 07:47 UTC] phpuser at infomediaire dot be
I'm using PHP 4.2.0. standalone (not as an apache module) on Apache 1.3.22 on NT 4.0 with SP6 (nobody's perfect ;)).

The following script

echo (count($_ENV)."<br>");
echo (count($_SERVER)."<br>");
echo (count($GLOBALS)."<br>");
echo (count($_GET)."<br>");
echo (count($_REQUEST)."<br>");
echo (count($HTTP_GET_VARS)."<br>");

give as result

The result is the same with register_globals set to on or off.

I want to access to each byte send in the HTTP header by the browser, even if some fields are not foreseen by RFC's.
Of course I can have a look on Globals but I'm not sure 
- that each line of the HTTP request will be there
- of what $Globals originate from the server or from the client.

Does anybody have the same problem ? Is it a bug ?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-18 16:30 UTC]
Please add the whole script, not just some part of it..
And $_GET will always be empty, if you don't pass any
values in the URL. e.g. access the script

 [2002-07-04 05:58 UTC] phpuser at infomediaire dot be
Thank you to all for the comments.
As far as I understand now (it was not clear to me while reading the doc), there is no way for me to get the
full http header of the request made by the client.
Only the variables (from a filled form) are available.
In my example, the request made by the client contains no 
field at all. What is the equivalent of "getallheaders" while running PHP not as an apache module but standalone ?
 [2002-07-04 09:24 UTC]
There is no way at the moment. Making this feature request.

 [2011-01-01 01:19 UTC]
-Package: Feature/Change Request +Package: *Web Server problem
 [2015-01-08 22:28 UTC]
-PHP Version: 4.2.0 +PHP Version: 5.6.0
 [2015-01-08 22:28 UTC]
It's currently supported by Apache, NSAPI (lol), FPM and the CLI server, but it should probably be supported in other places, too.

Upping version to 5.6.0 as it's still relevant today.
 [2017-10-20 17:58 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 [2017-10-20 17:58 UTC]
I'm gonna close this as, as of PHP 7.0+, all supported SAPIs seems to have support for getallheaders(), except for embed and phpdbg, both for obvious reasons
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 02:01:28 2024 UTC