dongzhang5006 2014-04-13 17:53
浏览 61
已采纳

facebook API错误:未经授权的源IP地址

getting this error after execting this php code in webhost (cloudaccess.net).

{"error":{"message":"(#5) Unauthorized source IP address","type":"OAuthException","code":5}}

can anyone can help me...?

<?php error_reporting(0);
    function url_get_contents ($url) {
    if (!function_exists('curl_init')){ 
        die('CURL is not installed!');
    }
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $output = curl_exec($ch);
    curl_close($ch);
    return $output;
}
$graph_url = 'https://graph.facebook.com/me?access_token=VALID_TOKEN';
$graph_data = url_get_contents($graph_url);

echo $graph_data;
?>
  • 写回答

1条回答 默认 最新

  • dseigqk7443 2014-04-13 19:10
    关注

    The IP address from which you're trying to use the Facebook API from is blacklisted, because someone else using the same IP address has violated the Facebook API Terms of Service. Unfortunately there's little you can do about that. The only way to get it working again is to get another IP address. I don't know a thing about cloudaccess.net, so I can't give an indication of how hard that will be or if it is even possible. Another possibility would be to proxy your requests through another IP address, but that would probably require another hosting account somewhere else and a whole new level of infrastructure.

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

报告相同问题?

悬赏问题

  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1
  • ¥20 求快手直播间榜单匿名采集ID用户名简单能学会的
  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题