开发者

$facebook->api() always fails and throws name lookup timeout exception

开发者 https://www.devze.com 2023-04-09 03:14 出处:网络
I m creating FB application using new graph api(iframe). Application works fine but when I开发者_运维技巧 call api method it throws exception. Say call to

I m creating FB application using new graph api(iframe). Application works fine but when I开发者_运维技巧 call api method it throws exception. Say call to

$permissions = $facebook->api("/me/permissions");
OR
$fbme     =   $facebook->api('/me');

always fails and throws "Name lookup timeout" exception. So I browse for this problem and found one solution that is changing facebook.php file in that set CURLOPT_CONNECTTIMEOUT from default 10 to higher value. But this solution doesn't work for me and I m getting same problem. Why this is happening. Is there any solution for this problem or any alternate method for api() on serverside.

Thanks in advance..


Are you sure you are using the new graph API?

You might try replacing "api-read.facebook.com" with "api.facebook.com" in the library you downloaded from facebook. (I think it's name is facebook.php)

And sometimes the Facebook server is not running 100%, you can check that here: http://api-status.com/6404/50042/Facebook-Graph-API

Also you should check your config, maybe you didn't set the correct App Id or Secret key.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号