views:

453

answers:

3

I am trying to use the new facebook api and it requires libcurl PHP. I used

sudo apt-get install php5-curl
sudo apachectl -k restart

And it didn't work. I get the same error and the phpinfo() page says nothing about libcurl.

The source of this problem is probably that I built some of the tools from source (apache2, php), but then I got bored so installed a lot of the extensions with the package manager. But I'm not exactly how to go about diagnosing the point of failure.

The apt-get install for curl definitely worked, and can be found in

/usr/lib/php5/20060613/curl.so

I think a lot of my confusion stems from not knowing which files go where, and what purpose they have. Any help would be appreciated, and please tell me if I need to provide more information.

edit: The specific error I get is:

Exception: Facebook needs the CURL PHP extension.

from line

if (!function_exists('curl_init')) {
  throw new Exception('Facebook needs the CURL PHP extension.');
}

Ubuntu: 9.10

PHP: 5.2.13

Loaded Configuration File: /etc/php5/apache2/php.ini

+1  A: 

Answer of Questions

What version of Ubuntu?

What version of PHP?

How is Apache and PHP set up?

What ini files does phpinfo() say is parsed? (should be near the top)

AlReece45
some of these questions are better made as comments, as they don't really add any answers to the question
Jorge Israel Peña
+1  A: 

In general it's a bad idea to mix and match software from your distribution's package manager with stuff you've built yourself. The package manager will not know anything about the stuff you've built yourself and so can get confused.

Not only that but who's to say the stuff from the package manager is even binary compatible with the stuff you've built yourself? If you build it all yourself then at least you know it will all be compatible.

Sounds to me like you should uninstall the extensions and build them yourself. If you can't or don't want to do that then go back and install apache and friends through your package manager but I would recommend having patience and going for the former option.

Troubadour
This is what I figured, and what my eventual recourse will be. I was hoping for a shortcut if it was just a configuration problem :)
FranticPedantic
@FranticPedantic: Probably a good idea. Don't get me wrong though, it may well be just a configuration problem in this case (which others will be better qualified to diagnose than me for sure) but I think you're better off with everything built the same way and then you know what you are dealing with.
Troubadour
A: 

Perhaps apt failed to properly modify your php.ini file to load the curl extension?

Check out your php.ini and see if you have line like:

extension=curl.so

or maybe:

extension=/usr/lib/php5/20060613/curl.so
timdev