|  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
 [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: Tue Jul 16 06:01:29 2024 UTC