我随机得到以下错误.它不会每次都发生.
PHP Fatal error: Uncaught CurlException: 28: Operation timed out after 60 seconds with 47 out of 47 bytes received
PHP Fatal error: Uncaught CurlException: 28: connect() timed out!
PHP Fatal error: Uncaught CurlException: 35: Unknown SSL protocol error in connection to graph.facebook.com:443
Run Code Online (Sandbox Code Playgroud)
我尝试过的是
1. adding CURLOPT_SSLVERSION => 3 (even try changing to 2)
2. changing 'https://api-read.facebook.com/' to 'api_read' => 'https://api.facebook.com/'
3. adding $opts[CURLOPT_SSLVERSION] = 3;
curl_setopt( $ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
4. Changing CURLOPT_CONNECTTIMEOUT => from 10 to 60
5. …Run Code Online (Sandbox Code Playgroud) 我知道有关"CSRF状态令牌与提供的令牌不匹配"问题的stackoverflow上有大量帖子.但是,我试过并没有解决这个问题.你能看一下我下面的代码吗?请告诉我您的想法以及如何解决问题.我已经更新到最新的PHP SDK版本.
<?
require_once ('src/facebook.php');
require_once ('src/fbconfig.php');
//Facebook Authentication part
$user_id = $facebook->getUser();
$loginUrl = $facebook->getLoginUrl(array(
'scope' => 'publish_stream')
);
if ($user_id) {
$_SESSION['user_id'] = $user_id;
echo "<script>top.location.href = 'https://www.example.com/app-folder/welcome'</script>";
exit;
}
?>
.
.
<body>
<?php echo '<a href="'.$loginUrl.'" target="_top">Please login</a>'; ?>
.
.
</body>
Run Code Online (Sandbox Code Playgroud)