PHP CURL timeout, no matter what timeout

I am writing a small program in php using curl to log in and download some reports from a service. The program works until one point appears where it is supposed to receive a report, after which the program will continue to count the time using the message below. Any ideas or suggestions? The server I'm connecting from is MS IIS Server, then it goes to this AkamaiGHost server for reporting.

Listed below are the curl factors that I use

curl_setopt($ch, CURLOPT_USERAGENT,$user_agent); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1); curl_setopt($ch,CURLOPT_COOKIEJAR,$cookie_file); curl_setopt($ch,CURLOPT_COOKIEFILE,$cookie_file); curl_setopt($ch,CURLOPT_CERTINFO,true); curl_setopt($ch,CURLOPT_HEADER,true); curl_setopt($ch,CURLOPT_HTTPAUTH,CURLAUTH_ANY); curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,true); curl_setopt ($ch, CURLOPT_CAINFO,'cacert.pem'); Report Response: HTTP/1.1 100 Continue HTTP/1.1 504 Gateway Time-out Server: AkamaiGHost Mime-Version: 1.0 Content-Type: text/html Content-Length: 250 Expires: Fri, 05 Jul 2013 19:14:43 GMT Date: Fri, 05 Jul 2013 19:14:43 GMT Connection: close <HTML><HEAD> <TITLE>Gateway Timeout - In read </TITLE> </HEAD><BODY> <H1>Gateway Timeout</H1> The proxy server did not receive a timely response from the upstream server.<P> Reference&#32;&#35;1&#46;ed690317&#46;1373051683&#46;bb2c2f0 </BODY></HTML> 
+4
source share
1 answer

I suspect that your IIS server (or the server on which the script is running) does not have a route to the AkamaiGHost server - this may be a firewall problem, a DNS problem or some other connection problem (AkamaiGHost may not be configured to listen for requests from your server?).

You must verify that you can perform outgoing requests on the server.

Try logging into the server where the script is running, and ping the AkamaiGHost server - if it works, try command-line curl (not SSL) - if it works, your problem may be caused by something interfering with outgoing connections on SSL port (443) - for example, your firewall.

0
source

Source: https://habr.com/ru/post/1489958/


All Articles