简体   繁体   English

cURL:操作在0毫秒后超时

[英]cURL: Operation timed out after 0 milliseconds

cURL gives me the error: cURL给了我错误:

Operation timed out after 0 milliseconds with 0 out of 0 bytes received

In particular, the "0 milliseconds" part is suspicious... 特别是,“0毫秒”部分是可疑的......

My initialization code: 我的初始化代码:

$curl = curl_init($requestUrl); // private URL not published
curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
curl_setopt($curl, CURLINFO_HEADER_OUT, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_HTTPHEADER, 
  array("Content-Type: application/xml", "Accept: application/xml"));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 20);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_HTTP200ALIASES, range(400, 599));
curl_setopt($curl, CURLOPT_SSLVERSION, 3);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

The timeout seems correctly set, what may be related it? 超时似乎设置正确,可能与哪些相关?

I had the same issue, when tried to connect via https. 当尝试通过https连接时,我遇到了同样的问题。 Problem was with ssl version. 问题出在ssl版本上。 This worked well for me: 这对我很有用:

$ch=curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSLVERSION, 3);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 cURL 错误 #:操作在 50007 毫秒后超时,收到 272389 个字节中的 30461 个 - cURL Error #:Operation timed out after 50007 milliseconds with 30461 out of 272389 bytes received php cURL操作在120308毫秒后超时,X收到-1个字节 - php cURL Operation timed out after 120308 milliseconds with X out of -1 bytes received cURL 错误 28:操作在 2000 毫秒后超时,收到 23000995 个字节中的 7276200 个 - cURL error 28: Operation timed out after 2000 milliseconds with 7276200 out of 23000995 bytes received curl php操作在120000毫秒后超时,收到234570字节 - curl php Operation timed out after 120000 milliseconds with 234570 bytes received magento 2 e curl 超时,main.CRITICAL:操作在 252 毫秒后超时 - magento 2 e curl timeout, main.CRITICAL: Operation timed out after 252 milliseconds Curl 总是超时,操作在 30001 毫秒后超时,收到 0 个字节 - Curl always timeout, Operation timed out after 30001 milliseconds with 0 bytes received WAMP/Wordpress - cURL 错误 28:操作在 10001 毫秒后超时,收到 0 个字节 - WAMP/Wordpress - cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received Wordpress/Godaddy - cURL 错误 28:操作在 10001 毫秒后超时,收到 0 个字节 - Wordpress/Godaddy - cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received LaravelFacebookSDK操作在0毫秒后超时,收到0个字节中的0个 - LaravelFacebookSDK Operation timed out after 0 milliseconds with 0 out of 0 bytes received cURL 错误 28 - x 毫秒后连接超时 - cURL error 28 - Connection timed out after x milliseconds
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM