I'm calling http_get_request_headers() in a PHP file on a server running PHP 5. However, I'm getting Fatal error: Call to undefined function http_get_request_headers(). Does anyone know what the problem might be? Does this function not come with plain PHP?
+2
A:
No it does not. You need a PECL module for that function to work. But you can use the contents of the $_SERVER variable as stated in this comment on the php site. Alternatively you can use the apache function if this is your web server.
soulmerge
2009-03-11 17:11:51
Thanks for the answer!
weicool
2009-03-12 08:28:17
+1
A:
That function is part of the PECL extension.
Follow the instructions on this page to install it: http://ar.php.net/manual/en/http.install.php
Seb
2009-03-11 17:12:09
A:
Have you read the Installation and Configuration guide for the HTTP classes/functions?
Gumbo
2009-03-11 17:13:04