title: 504 Gateway Time-out in php curl_setopt
body: <p>I am trying to hit the website url on the proxy url using a php code. I get it from google and trying to use it but when I run this code I am getting</p>
  
  <blockquote>
    <p>504 Gateway Time-out The server didn't respond in time.</p>
  </blockquote>
  
  <p>I am not able to find out real reason behind this error what I have to do for this .. Here is the code which I am using </p>
  
  <pre><code>&lt;?php
  $curl = curl_init();
  $timeout = 3000;
  $proxies = file("proxy.txt");
  $r="https://abcdefgh.com";
  // Not more than 2 at a time
  for($x=0;$x&lt;25; $x++){
      //setting time limit to zero will ensure the script doesn't get timed out
      set_time_limit(0);
  
      //now we will separate proxy address from the port
      //$PROXY_URL=$proxies[$getrand[$x]];
      echo $proxies[$x];
      curl_setopt($curl, CURLOPT_URL,$r);
      curl_setopt($curl , CURLOPT_PROXY , $proxies[$x]);
      curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5");
      curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $timeout);
      curl_setopt($curl, CURLOPT_REFERER, "http://google.com/");
      $text = curl_exec($curl);
  
      echo "Hit Generated:";
      echo $x;
  
  }
  
  ?&gt;
  </code></pre>