pecl_http and http_get on Ubuntu

758 views
Skip to first unread message

dwhsix

unread,
Dec 16, 2008, 11:51:30 AM12/16/08
to Professional PHP Developers
Hoping someone can provide assistance in getting pecl_http to work.
I'm completely baffled.

I'm trying to just confirm it works from the CLI, but can get nothing
but "Fatal error: Call to undefined function http_get()"

pecl tells me it's installed:
$ pecl install pecl_http
Ignoring installed package pecl/pecl_http
Nothing to install

phpinfo() *seems* to tell me its installed and enabled, but I wonder
if there's some detail there that isn't correct: http://pastebin.com/m53ed94e5

In /etc/php5/cli/php.ini, I left extension_dir commented out, and
http.so is listed:
extension=http.so

When I try to use http_get in the CLI, I get:
$ php -a
Interactive shell

php > http_get('http://www.google.com');

Fatal error: Call to undefined function http_get() in php shell code
on line 1


Googling seems to indicate this is a common problem, but I couldn't
find any solutions. Much thanks for any assistance...

dwh

dwhsix

unread,
Dec 16, 2008, 1:04:02 PM12/16/08
to Professional PHP Developers
Figures. In the time it took for this to show up, I resolved this.

I had forgotten that when I installed pecl_http, it acually didn't
finish correctly because curl/curl.h was missing. So I uninstalled
it, apt-get'd libcurl4-openssl-dev, used pecl to install pecl_http
again, and now it works.

But it was interesting that even when I had a botched pecl_http
install, php seemed to think it was there, at least in some form...

dwh


On Dec 16, 11:51 am, dwhsix <de...@haskinferguson.net> wrote:
> Hoping someone can provide assistance in getting pecl_http to work.
> I'm completely baffled.
>
> ...
Reply all
Reply to author
Forward
0 new messages