【问题标题】:Uncaught CurlException: 7: couldn't connect to host thrown in /xxx/base_facebook.php on line 886未捕获的 CurlException:7:无法连接到第 886 行 /xxx/base_facebook.php 中抛出的主机
【发布时间】:2012-06-19 19:37:02
【问题描述】:

我在使用 Facebook PHP-SDK 为我的网站实现 FB 登录时遇到上述错误。我尝试更改 iptables 以打开端口 80 和 443。目前我的 iptables 如下所示:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            multiport dports www,https       state NEW,ESTABLISHED 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:www 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:https 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:www 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:https 

【问题讨论】:

    标签: facebook-php-sdk iptables


    【解决方案1】:

    Facebook 最近开始接受通过 IPV6 发送到 Graph API 服务器的请求。

    检查您系统的 IPV6 接口是否配置正确,如果不正确则禁用它。

    这是最近 2/3 的人询问“无法连接到主机”错误的原因。

    【讨论】:

    • 那么这可能是您这边的服务器配置问题,实际上不在 stackoverflow 的范围内 - 也许试试 serverfault.com
    • 谢谢lgy。我去看看。
    猜你喜欢
    • 2013-09-22
    • 2012-12-12
    • 1970-01-01
    • 2012-05-13
    • 1970-01-01
    • 2016-01-26
    • 2013-04-28
    • 2015-06-02
    • 2011-07-20
    相关资源
    最近更新 更多