title: PHP CURL timing out , no matter what timeout is
body: <p>I am writing a little program in php utilizing curl to login and download some reports from a service. The program works fine up until this one point where it is supposed to get the report, then the program keeps timing out with the below message. Any ideas or suggestions? The server I connect to originally is a MS IIS Server, then it jumps to this AkamaiGHost server for reports.</p>
  
  <p>Below are the curl setopts I am using</p>
  
  <pre><code>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
  
  &lt;HTML&gt;&lt;HEAD&gt;
  &lt;TITLE&gt;Gateway Timeout - In read &lt;/TITLE&gt;
  &lt;/HEAD&gt;&lt;BODY&gt;
  &lt;H1&gt;Gateway Timeout&lt;/H1&gt;
  The proxy server did not receive a timely response from the upstream server.&lt;P&gt;
  Reference&amp;#32;&amp;#35;1&amp;#46;ed690317&amp;#46;1373051683&amp;#46;bb2c2f0
  &lt;/BODY&gt;&lt;/HTML&gt;
  </code></pre>