Reputation: 23
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
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
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:
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
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
Restart your Apache server.
Check your phpinfo()
to see whether curl has properly enabled or not.
Upvotes: 1
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