我随机收到以下错误。它不会每次都发生。
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
我尝试过的是
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. closing IPv6 and add 69.171.224.54 graph.facebook.com to /etc/hosts (several other IPs also added)
6. telnet graph.facebook.com 443 and nslookup graph.facebook.com
我不知道在哪里可以看得更远。请帮忙!
仅供参考:cURL支持=启用,cURL信息= 7.15.5,OpenSSL版本= 0.9.8e(最新版本我可以在Centos 5.7上更新)
答案 0 :(得分:3)
所有这些错误都与HTTP进程各个阶段的连接超时有关:
正如肖恩·卡特上面所说,这个问题与https://developers.facebook.com/bugs/328399317246454?browse=search_4ff4817e0c5ec9768956669
这个问题似乎是同一个问题Can not connect to Facebook with a curl request最终,这只意味着Facebook的API服务器比预期慢一点。您可以尝试使用更长的超时,或者,因为它是间歇性的,捕获异常并再次尝试。