Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've installed PHP's pecl_http extension using the Amazon Linux php54-pecl-http Yum package.

  • php -i shows the http.ini file loaded
  • http.ini has the line in it
  • php -m shows the HTTP module as installed
  • pecl list shows pecl_http 2.0.0beta1 as installed.

However, when I attempt to use any of its functions - new HttpRequest(), http_build_url(), etc. - they come back as nonexistent. I am running everything on the CLI (this is a utility server) so no chance of disparate php.ini files between environments.

php -i's http block states:


HTTP Support => enabled
Extension Version => 2.0.0beta1

Used Library => Compiled => Linked
libz => 1.2.5 => 1.2.5
libcurl => 7.24.0 => 7.24.0
libevent => 1.4 or greater => 2.0.18-stable
libserf => disabled => disabled

                            Persistent Handles                            
Provider => Ident => Used => Free
http_client.curl => N/A => 0 => 0
http_client_pool.curl => N/A => 0 => 0
http_client_datashare.curl => N/A => 0 => 0

Directive => Local Value => Master Value
http.etag.mode => crc32b => crc32b
http.persistent_handle.limit => -1 => -1

Has anyone experienced this? Any ideas?

share|improve this question
up vote 3 down vote accepted

Maybe a little late, but perhaps this helps someone else landing here...

Insure that you are referencing the correct version of the pecl_http API. They moved to namespaces in v2, so the calling convention is quite different. Much of the documentation around on the web references methods in v1.

share|improve this answer

Please try

strace -fF -o /tmp/wtf php your_php_script.php

And then comb through /tmp/wtf file with a text editor/viewer/grep variant of your choice to see 1) proper php.ini was read and 2) if extension was actually loaded.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.