tags:

views:

388

answers:

3

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
Thanks for the answer!
weicool
+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
A: 

Have you read the Installation and Configuration guide for the HTTP classes/functions?

Gumbo