【发布时间】:2014-09-17 21:52:43
【问题描述】:
当我尝试从我的网站使用 facebook 登录时,出现此错误
致命错误:未捕获的 GraphMethodException:不支持的获取请求。请阅读位于/home2/******/public_html/includes/facebook/base_facebook.php 第 1271 行的https://developers.facebook.com/docs/graph-api 的 Graph API 文档
一开始,一切都很好。我没有改变任何东西。我该怎么做才能解决这个问题?
/**
Analyzes the supplied result to see if it was thrown
because the access token is no longer valid. If that is
the case, then we destroy the session.
@param $result array A record storing the error message returned
by a failed API call.
**/
protected function throwAPIException($result) {
$e = new FacebookApiException($result);
switch ($e->getType()) {
// OAuth 2.0 Draft 00 style
case 'OAuthException':
// OAuth 2.0 Draft 10 style
case 'invalid_token':
// REST server errors are just Exceptions
case 'Exception':
$message = $e->getMessage();
if ((strpos($message, 'Error validating access token') !== false) ||
(strpos($message, 'Invalid OAuth access token') !== false) ||
(strpos($message, 'An active access token must be used') !== false)
) {
$this->destroySession();
}
break;
}
throw $e;
}
【问题讨论】:
-
当你得到那个错误时你在做什么请求
-
发布流和电子邮件
-
我很确定这不是您正在做的请求。但是显示代码以及致命事件发生在哪一行
-
看看那个链接“facebook.com/dialog/…”和第1271行
$e = new FacebookApiException($result); -
这不是您发送的请求
标签: php facebook facebook-graph-api