0

Hi, i have this bas_facebook.php to login with facebook on my website, but it gives me error with the exception:

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

/**
 * Thrown when an API call returns an exception.
 *
 * @author Naitik Shah <naitik@facebook.com>
 */
class FacebookApiException extends Exception
{
  /**
   * The result from the API server that represents the exception information.
   */
  protected $result;

  (...)

This are the errors:

( ! ) Fatal error: Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension.' in C:\wamp\www\facebook\lib\base_facebook.php on line 19
( ! ) Exception: Facebook needs the CURL PHP extension. in C:\wamp\www\facebook\lib\base_facebook.php on line 19

3
Contributors
2
Replies
10
Views
4 Years
Discussion Span
Last Post by pritaeas
0

That error means that you do not have your CURL extension enabled. Are you running a local server or a hosted server? If you are using a local server, you can navigate to the folder in which your php.ini file resides (for me that's "\xampp\php"), open up that php.ini file, ctrl+f to find "curl" and remove the semicolon (";") in front of that line (if a semicolon is there) to enable the CURL extension. You will have to restart your server for changes to take effect.

Edited by minitauros

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.