无法通过PHP在Facebook中检索“我”个人资料信息

时间:2010-09-18 02:19:51

标签: php facebook facebook-graph-api

我正试图通过PHP获取一些个人资料信息,如<,p>中所述

  

http://developers.facebook.com/docs/authentication/

$user = json_decode(file_get_contents(
'https://graph.facebook.com/me?access_token=' .
$cookie['access_token']))->me;

当我运行此代码时,我收到以下警告:

  

警告:file_get_contents(.....)[function.file-get-contents]:无法打开流:第30行/home/website/public_html/helloworldpp/index.php中没有此类文件或目录< / p>

我已截断并添加“.....”而不是实际的网址。但是,当我通过浏览器访问“.....”URL时,我得到了json响应。我不知道为什么我无法通过PHP代码获取它。有人可以帮帮我吗?

非常感谢。

1 个答案:

答案 0 :(得分:1)

在您的网络服务器上禁用打开文件打开的网站是可能的。您可能需要考虑使用Curl

相关问题