1
我有以下的config.php文件坐在www.sitename.com/facebook/这段代码为什么会抛出Facebook API Error 191?
<?php
require_once 'library/facebook.php';
$app_id = "xyz";
$app_secret ="xyz"
$facebook = new Facebook(array (
'appId' => $app_id,
'secret'=> $app_secret,
'cookie'=> true
));
if(is_null ($facebook->getUser()))
{
header("Location:{$facebook->getLoginUrl(array('req_perms'=>'user_status, publish_stream, user_photos'))}");
exit;
}
?>
在注册应用程序中使用的网站的网址是http://www.sitename.com/facebook/
因此在运行这个文件应该直接我的授权页面......相反,我得到以下错误:
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
任何一个可以解释如何解决这个问题,为什么出现这种情况?
什么是'redirect_uri'被设置为? – ceejayoz 2011-04-06 18:55:09
我相信它通过facebook PHP-SDK中的getLoginUrl方法设置为currentURL(即mysite.com/facebook/),所以没有看到问题的原因 – algorithmicCoder 2011-04-06 19:23:08
[Facebook API错误191](http ://stackoverflow.com/questions/4691782/facebook-api-error-191) – genesis 2011-10-26 19:03:29