Hi everyone, I have been trying to code a facebook application using the API.
Within this, I am required to include the base_facebook.php file.
But I keep gertting an error
Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. thrown in base_facebook.php on line 1033
I have been doinf some digging around and a number of websites say there should be additional CURL information sent when hosting with godaddy shared hosting as godaddy use a proxy server.
Here is the code from the websites.
...assuming that $ch is the curl handle.
A full example...
<?php
$url = "http://www.google.com/";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt ($ch, CURLOPT_PROXY,"http://64.202.165.130:3128");
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
$response = curl_exec ($ch);
if(is_int($response)) {
die("Errors: " . curl_errno($ch) . " : " . curl_error($ch));
}
curl_close ($ch);
print "Remote Site : $url<br /><hr />$response";
?>
Here is the curl configuration in the base_facebook.php
curl_setopt_array($ch, $opts);
$result = curl_exec($ch);
if (curl_errno($ch) == 60) { // CURLE_SSL_CACERT
self::errorLog('Invalid or no certificate authority found, '.
'using bundled information');
curl_setopt($ch, CURLOPT_CAINFO,
dirname(__FILE__) . '/fb_ca_chain_bundle.crt');
$result = curl_exec($ch);
}
if ($result === false) {
$e = new FacebookApiException(array(
'error_code' => curl_errno($ch),
'error' => array(
'message' => curl_error($ch),
'type' => 'CurlException',
),
));
curl_close($ch);
throw $e;
}
curl_close($ch);
return $result;
}
What I dont no is how to add the additional curl configuration to base_facebook.php file
Cheers