I'm trying to develop a sample facebook php login example following the example here
I've hosted my app here, but I'm getting the error message in the question whenever I try to access the link. Here's the code segment that throws the error
try {
$e = new FacebookApiException(array(// LINE 887
'error_code' => curl_errno($ch),
'error' => array(
'message' => curl_error($ch),
'type' => 'CurlException',
),
));
curl_close($ch);
}
// edit suggested by Kneel-before ZOD
catch(FacebookApiException $e) {
$result = $e->getResult();
echo 'Got an : ', $e->getType(),' while posting';
echo(json_encode($result));
}
catch(Exception $e){
echo 'Caught exception: ', $e->getMessage(), "\n";
}
Im quite sure Ive setup the APP ID and secret correctly in index.php.
Here's a screenshot of my app setup on facebook
Any help would be appreciated. Thanks!
You may need to give curl a certificate file for Facebook which you do like this:
Download the certificate files from https://github.com/facebookarchive/facebook-php-sdk/blob/master/src/fb_ca_chain_bundle.crt
and add this before attempting any Facebook calls
facebook::$CURL_OPTS[CURLOPT_CAINFO] = 'path/to/fb_ca_chain_bundle.crt';
You could also try
facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;
facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With