2013-04-03 64 views
0
file_get_contents('https://graph.facebook.com/me/accounts?access_token=ACCESS_TOKEN_HERE'); 

當我打開瀏覽器該鏈接,以我的訪問令牌它給了我所有的Facebook頁面的列表,當我嘗試用file_get_contents呼應它,它提供了以下錯誤:當我使用graph-api時,爲什麼file_get_contents不能與https協同工作?

Warning: file_get_contents(https://graph.facebook.com/me/accounts?access_token=ACCESS_TOKEN_HERE) [function.file-get-contents]: failed to open stream: Permission denied in /home/www/***********.php on line 4

而且file_get_contents適用於任何其他網站。

+0

你可以在不同的https網址上使用'file_get_contents'嗎? – Eldar

+0

HTTPS請求上的_permission denied_ error?奇怪的是,許可錯誤通常發生在本地文件系統中,但在使用HTTP(S)時不會發生。我寧願期待一個HTTP錯誤代碼。 – CBroe

+0

Eldar 我檢查了它..我無法獲得任何其他URL上的file_get_contents。 – thezucknotes

回答

1

如果您使用的是php sdk,請在base_facebook.php中每行包含curl_exec之前使用curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);來嘗試。 如果它有效,那麼你可以知道問題出在哪裏。

相關問題