Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 extension=http.so 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

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

2 Answers 2

up vote 2 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.

http://devel-m6w6.rhcloud.com/mdref/http

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 http.so extension was actually loaded.

share|improve this answer

Your Answer

 
discard

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.