0

我刚刚在 heroku 上托管了我的 facebook 应用程序,我按照教程提交了我的工作将其推送到远程。我刷新了托管页面 url 它显示了第一页,当我使用左上角的 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.
4

1 回答 1

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
于 2013-05-25T19:57:36.703 回答