致命错误:未知CurlException在...的API连接超时在api 3.0.0在base.facebook.php [英] Fatal error: Uncaught CurlException SSL connection timeout in facebook api 3.0.0 in base.facebook.php
问题描述
我有两个星期前同一个问题,两台电脑在Archlinux上运行,卷曲7.24。
默认情况下,卷曲使用SSL版本3,但在我的电脑上看起来像卷曲一样 https://graph.facebook.com 结束了一个超时,而当我特别要求卷曲使用SSL版本3时,它工作。所以在这里我如何解决这个问题:
在Facebook PHP SDK中,在base_facebook.php中,替换:
public static $ CURL_OPTS = array(
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
CURLOPT_USERAGENT =>'facebook-php-3.1',
);
By:
code> public static $ CURL_OPTS = array(
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
CURLOPT_USERAGENT => 'facebook-php-3.1',
CURLOPT_SSLVERSION => 3,
);
i am getting same ssl error for all version of php-sdk i have increased timeout value but strill same problem but when i tried same sample code on different server it working well. i think there is might be something server related issue like version of lib curl or openssl can you help me ?
I had the same issue two weeks ago with two computers running on Archlinux with curl 7.24.
Curl use SSL version 3 by default but it looks like on my computers the curl to https://graph.facebook.com ended up in a timeout whereas it worked when I specifically asked curl to use SSL version 3. So here how I solved the issue :
In the Facebook PHP SDK, in base_facebook.php, replace :
public static $CURL_OPTS = array(
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
CURLOPT_USERAGENT => 'facebook-php-3.1',
);
By :
public static $CURL_OPTS = array(
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
CURLOPT_USERAGENT => 'facebook-php-3.1',
CURLOPT_SSLVERSION => 3,
);
这篇关于致命错误:未知CurlException在...的API连接超时在api 3.0.0在base.facebook.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!