title: Trouble using PHP Curl + Proxies to Query Google
body: <p>Having trouble with Google blocking my IPs when querying Google for content matches.  I've got 300 private IPs and have no trouble connecting to Google with a desktop app (w/ the same IPs) that performs a similar function.  Yet, when I crank it up on my server using CURL my IPs get temporarily blocked - your machine maybe sending automated queries, please try again in 30 secs.  So there must be a footprint somewhere.</p>
  
  <p>Any how here's my code:</p>
  
  <pre><code>    function file_get_contents_curl($url, $proxy = true) {
  
      global $proxies;
      App::import('Vendor', 'proxies');
  
      $proxies = $this-&gt;shuffle_assoc($proxies);
      $proxy_ip = $proxies[array_rand($proxies, 1)];//proxy IP here
      $proxy = $proxy_ip.':60099';
  
      $loginpassw = 'myusername:mypassword';  //proxy login and password here
  
      $ch = curl_init();
  
      if($proxy) {
  
          curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); 
          //curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
          curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');
          curl_setopt($ch, CURLOPT_PROXY, $proxy);
          curl_setopt($ch, CURLOPT_PROXYUSERPWD, $loginpassw);   
          curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)');  
      }
  
      curl_setopt($ch, CURLOPT_HEADER, 1);
      @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
      //Set curl to return the data instead of printing it to the browser.
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
      curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
      curl_setopt($ch, CURLOPT_URL, $url);
      $data = curl_exec($ch);
      //echo $data;
      curl_close($ch);
      return $data;
      }
  </code></pre>
  
  <p>And I've verified that the IP is being set and that I'm connecting thru the proxy.  </p>
  
  <p>Anyone got any ideas?</p>