Sunday, 11 August 2013

Facebook login api: Failed to connect to 31.13.84.16: Permission denied

Facebook login api: Failed to connect to 31.13.84.16: Permission denied

i'm trying to integrate Facebook login into mysite. I'm using Facebook PHP
SDK (https://github.com/facebook/facebook-php-sdk).
Code below is not working
require_once 'facebook/src/facebook.php'; //include the facebook php sdk
$facebook = new Facebook(array(
'appId' => 'xxxxxx', //app id
'secret' => 'xxxxxx', // app secret
));
$user = $facebook->getUser();
if ($user) { // check if current user is authenticated
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me'); //get current user's profile
information using open graph
}
catch(Exception $e){}
} else {
}
Facebook user id is saved in $user variable (and is correct and working)
but $user_profile variable return empty variable.
I get bellow error...
FacebookApiException Object
(
[result:protected] => Array
(
[error_code] => 7
[error] => Array
(
[message] => **Failed to connect to 31.13.84.16: Permission denied**
[type] => CurlException
)
)
Does anybody know where is the problem? Is the problem with my webhosting
provider? What can i do?
Thank you for support.

No comments:

Post a Comment