user3168567
user3168567

Reputation: 23

Facebook needs the CURL PHP extension error

I am creating a Facebook app using php...downloaded the php-sdk from github but everytime I run the file I get this error ---

Fatal error: Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension.

I have removed the comment from php.ini file stored in xampp/php but still I'm getting the same error.

Upvotes: 1

Views: 8588

Answers (3)

ahmed hamdy
ahmed hamdy

Reputation: 5169

If you Operating System is Ubuntu

To solve this exception ,you need to download curl for php5 .

1) Just run this command line from your terminal :

sudo apt-get install php5-curl

2) Then restart your apache :

sudo /etc/init.d/apache2 restart

Upvotes: 6

Tony Stark
Tony Stark

Reputation: 8084

Check your changes,

<?php phpinfo(); ?>

CURL support enabled is necessary.

Enabling CURL in PHP (PHP.ini, WAMP, XAMPP, Ubuntu).

Following steps to enable curl library with XAMPP in Windows:

Step 1:

Browse and open the following 3 files

C:\Program Files\xampp\apache\bin\php.ini
C:\Program Files\xampp\php\php.ini
C:\Program Files\xampp\php\php4\php.ini

Step 2:

Uncomment the following line in your php.ini file by removing the semicolon (;).

;extension=php_curl.dll

After that it will look something like something below-

extension=php_curl.dll

Step 3:

Restart your Apache server.

Step 4:

Check your phpinfo() to see whether curl has properly enabled or not.

Upvotes: 1

tally
tally

Reputation: 11

Do you see the changes when you output

<?php phpinfo() ?>

Maybe you forgot to restart your apache server after you made the changes?

Upvotes: 0

Related Questions