duanchen9594 2011-09-28 06:24
浏览 41
已采纳

$ facebook-> api()总是失败并抛出名称查找超时异常

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..

  • 写回答

1条回答 默认 最新

  • dongxianrang9269 2011-09-28 13:57
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写
  • ¥20 Qcustomplot缩小曲线形状问题
  • ¥15 企业资源规划ERP沙盘模拟
  • ¥15 树莓派控制机械臂传输命令报错,显示摄像头不存在
  • ¥15 前端echarts坐标轴问题
  • ¥15 ad5933的I2C
  • ¥15 请问RTX4060的笔记本电脑可以训练yolov5模型吗?
  • ¥15 数学建模求思路及代码
  • ¥50 silvaco GaN HEMT有栅极场板的击穿电压仿真问题