ErrorCurlException:7:无法连接到255.255.255.255:网络无法访问

时间:2014-02-16 23:32:29

标签: php facebook facebook-graph-api

我在PHP代码中收到此错误:

ErrorCurlException: 7: Failed to connect to 255.255.255.255: Network is unreachable

这是我的代码:

require_once 'src/facebook.php'; //include the facebook php sdk
$facebook = new Facebook(array(
    'appId'  => '*************',    //app id
    'secret' => '**********************', // app secret
));

$user = $facebook->getUser();

if ($user) { // check if current user is authenticated
    try {
        // Proceed knowing you have a logged in user who's authenticated.

        $user_profile = $facebook->api('/me');  //get current user's profile information using open graph
        $email = $user_profile['email'];
        echo"<script>alert(\"$name\");</script>";
    } catch(Exception $e)    {
        $name="Error".$e;
    }
}
echo"<script>alert(\"$name\");</script>";
?>

相同的代码正在处理不同的页面。我只是一个初学者,对FB API了解不多。

0 个答案:

没有答案