I'm working on a PHP Client for CouchDB. While browsing through the php.net documentation regarding HTTP and cURL, I came across the PECL_HTTP Extension. At first glance, I think I would like to use this PECL extension instead of cURL because it's much simpler to use, and I'm not doing very complicated HTTP work anyways. Plus I always like trying new things, so I wouldn't mind getting my feet wet.
As far as my question to the StackOverflow community:
Edit: As it turns out, the PECL_HTTP extension uses some of the cURL source code under the hood, so they aren't completely different beasts. Both are also compiled extensions to PHP.
In my opinion CURL is straightforward and easy to pick up. In PHP Cookbook (O'Reilly, 2002) CURL was chosen for various (performance) reasons.
The PECL_HTTP extension has proven much simpler to use, almost cutting my code in half in some places. :)
At first I have to say we used both at our company and from the handling I like php_http more and I appreciate the work of Mike.
But we abandoned php_http because it is not bundled in vanilla php. We are working in a windows environment and for each pecl extension which is not bundled by php itself, we have to compile it ourselves (which is not a bad thing). While compiling we got an error that some headers were missing. It turned out it was totally our fault, because it's clearly stated in the documentation.
And the since version 2.0 of php_http, it has two none-standard dependancies: - raphf 1.0.0 or newer - propro 1.0.0 or newer
So we needed to compile more than only php_http. But for propro 1.0.0 (2013-08-12) config.w32 was missing in the download (at least in the state of writing). So we had to write our own one. And so on...
In the end we got it working for PHP 5.5 VC11 x86, but it took some time. In companies you sometimes doesn't have time to spend on such things. Curl always works out of the box, because it's bundled. This might be a serious reason not to use php_http.
Something I would really appreciate is if php_http would do it into vanilla php.
Hope this helps some decision makers ;-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With