2013-05-25 72 views
0

我剛剛在heroku上託管了我的Facebook應用程序,我跟着教程提交我的工作將其推送到遠程。我刷新了託管頁面的網址它顯示了第一頁,因爲它顯示的時候我使用了左上角的Facebook登錄按鈕,它詢問了公共信息的許可,然後在間隔後沒有任何事情發生,它拋出「此網頁有一個重定向循環」無法解析無限重定向循環?

這是網址: https://glacial-dusk-9875.herokuapp.com/

我已經添加下面的index.php中線路

// Here is an example of a FQL call that fetches all of your friends that are 
    // using this app 
    $app_using_friends = $facebook->api(array(
    'method' => 'fql.query', 
    'query' => 'SELECT uid, name FROM user WHERE uid IN(SELECT uid2 FROM friend WHERE uid1 = me()) AND is_app_user = 1' 
)); 
    // my code/changes start here 
    $app_liked = $facebook->api(array(
     'method'  => 'fql.query', 
     'query'  => 'SELECT uid,page_id FROM page_fan WHERE uid=me() AND page_id=' . $pageId 
)); 
var_dump($app_liked); 

欣賞@phwd幫助,我能看到自己成功地訪問該網頁,但現在又同單刷新後問題:

Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects. 
+1

似乎爲我工作,嘗試清除您的Cookie。 – phwd

+0

哦謝謝,現在工作很好。 – justnajm

+0

仍然有同樣的問題:錯誤310(net :: ERR_TOO_MANY_REDIRECTS):有太多的重定向。 – justnajm

回答

2

檢查您的PHP SDK SHA或版本。我猜測你們是

的情侶修訂版本heroku模板引用了PHP SDK @ 98f2be163c96a51166354e467b95dd38aa4b0a19,它不適合擁有最新的CA證書。

https://github.com/heroku/facebook-template-php

可能需要更新的是git的子模塊

http://git-scm.com/book/en/Git-Tools-Submodules

16d696c138b82003177d0b4841a3e4652442e5b1 Merge pull request #69 from anankan/master 
0b0d711498fb4a283ce84802c34e49a491134a1f Added the extra param: appsecret_proof to the oauth api calls 
bf99924386be074da30a8e9d6bbcb49d3333da12 Merge pull request #57 from kilotaras/vulnerability_bug 
7324e40d74599a747e81af358c6ef5405539a5dd Fixed a vulnerability with signed requests 
aecd4bfba0b5bd8e237269732cea7da2f8f1a34c Merge pull request #50 from evanadelman/master 
1899bf9f0a88aa885db03febb6980ec7bc0ad1e7 Merge pull request #45 from favrik/master 
2041c94716e6186b6f9dd3ce2314977899f9ea02 clarified apache specific lookup for ssl & added ability to loo 
ca9472b3312dab3fdcfbffb4e45eb091f582dcb7 Avoid trying to reuse spent authorization codes 
1a84329fcc8b0fa0afaf3617cd9fb15a25eff95e Use `empty()` for signed request value check 
c81dfdea4f6ae9c902cf367dc52dc205f4d7c4f5 bump version to 3.2.1 
bac1e25e420770867efb3286d9ee2cfd7addaea5 fix broken tests and remove some broken ones 
42961c500761dd62099bf633a5db7182c00c1678 updated cert bundle to use the current curl bundle 
98f2be163c96a51166354e467b95dd38aa4b0a19 Merge pull request #35 from bfanger/master 
339f504a24520c2f53ac08ad03efaf9f26ae4420 Updated version number 
+0

非常感謝你解決了這個問題。擁抱到stackoverflow成員 – justnajm

+0

我使用本地主機開發的heroku應用程序,但我仍然有循環問題: 我已經想通了:(!)致命錯誤:未捕獲異常:601:解析器錯誤:意外的查詢結束。拋出在C:\ Users \ najm \ glacial-dusk-9875 \ sdk \ src \ base_facebook.php on line 1271 我也知道這發生在你在一個域內有很多facebook應用程序目錄。 – justnajm

+0

@justnajm'page_id'的代碼不在上面,儘管我的猜測是您的FQL查詢存在問題 – phwd