简体   繁体   中英

Google Cloud PHP Curl timeout

I met this error sometimes on some CURL requests done (adding CURL options directly in the PHP like CURLOPT_TIMEOUT change nothing, and i use SDK for most of them...) :

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

The "0 milliseconds" is always here, never more. Seems like an "internet down" and so, URL are unreachable.

Any idea about a possible Google Cloud configuration to do maybe ?

EDIT : in verbose mode i've got "Hostname was NOT found in DNS cache". And then it reconnect again.

Thanks !

You can try to add these options to your CURL code:

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

These options were suggested on: cURL: Operation timed out after 0 milliseconds

Finally it was just the normal "error" before doing an update on the DNS cache. So CURL do the request then, can't access to the distant server because IP has changed and get "Hostname not found". Here, he get the new IP and doing again the request, with success.

So no issue !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM