I've installed PHP's pecl_http
extension using the Amazon Linux php54-pecl-http
Yum package.
php -i
shows thehttp.ini
file loadedhttp.ini
has theextension=http.so
line in itphp -m
shows the HTTP module as installedpecl list
showspecl_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?
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
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.