go to bug id or search bugs for
I try to create a new \http\Client as per the documentation and it throws an exception. Passing in "curl" as the only parameter results in exactly the same issue with a slightly different error message. The curl extension is present and working. I have stock Ubuntu PHP from saucy (13.30) PHP 5.5.3-1ubuntu2.1
$client = new http\Client();
PHP Fatal error: Uncaught exception 'http\Exception\UnexpectedValueException' with message 'Failed to locate "(null)" client request handler' in /home/.../pecl-testcase.php:3
#0 /home/.../pecl-testcase.php(3): http\Client->__construct()
thrown in /home/.../pecl-testcase.php on line 3
Add a Patch
Add a Pull Request
That old myth that the curl extension has to be present/enabled/loaded/whatever for pecl_http to work is really a though one... :) It is/was needed on Windows because there were some symbol exporting issues iwht zlib, libcurl and pecl_http, but I think that this is not any longer the case.
pecl_http has to be built with libcurl support for the client to work, i.e. configure output should indicate the appropriate curl headers and libraries were available when compiling the extension.
If you didn't already, apt-get install libcurl3-dev-openssl or something similiar; I don't know the exact name off the top oof my head, and re-install pecl_http (and watch the configure output).
PS: Lorna, you know where to find me on IRC/Twitter/etc... :)
Ah, that helps. Aptitude offers me a package called libcurl3-openssl-dev and installing that and then reinstalling the pecl extension allows me to at least instantiate the object. Would it be possible to pick that up at configure time? Let me know if I can test or help more.
Uh, what do you mean by "at least"?
And what should be picked up at configure time?
Let me rephrase my hasty comments.
I can confirm that I can instantiate the object now. I cannot confirm if anything else works as I haven't had chance to revisit my script - but I wanted to update this bug with at least that minimal information.
My second question is: Could the configure script identify that I was missing a dependency? From a user perspective I was really surprised to see a successful install reported, and then have the extension unusable.
Well, it actually is everything else than unusable, it's "just" the client functionality that's missing.
Okay, in most cases, that might be the reason one installed this extension, but it still provides plenty of functionality besides the client.