title: CURL error "couldn't connect to host" on http server only
body: <p>i call a <code>CURL</code> code for calling a URL (the URL sends an email).
  When i call the URL from the browser, it works, but when i execute it from the curl php code, it doesn't work.</p>
  
  <p>also, <strong>the exact same curl code works on my https SSL production server,</strong> but not on my http development server.</p>
  
  <p>The error i get on my development http server is "<strong>couldn't connect to host</strong>".</p>
  
  <p>This is the code:</p>
  
  <pre><code>$ch = curl_init();
  
  $requestedUrl = http://XXX.XXX.XX.XX/myproject/index.php?entryPoint=viewReport&amp;record=.....etc..
  
  curl_setopt($ch, CURLOPT_URL, $requestedUrl);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
  $data = curl_exec($ch);
  if ($data === FALSE) {
      $GLOBALS['log']-&gt;fatal("error = " . print_r(curL_error($ch),true));
  }
  
  curl_close($ch);
  </code></pre>
  
  <p>i read every post there is on this issue. 
  i don't know if i'm behind proxy or not and i dont know how to get the ip of the proxy if i'm behind one.</p>
  
  <p>i have tried adding <code>curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);</code></p>
  
  <p>tried adding :</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');
  curl_setopt($ch, CURLOPT_PROXY, "http://XXX.XXX.XX.XX"); //your proxy url
  curl_setopt($ch, CURLOPT_PROXYPORT, "80"); // your proxy port number
  </code></pre>
  
  <p>tried opeining port 1080 in the firewall (which is open for any http address).</p>
  
  <p>i'm out of ideas, so please help me :)</p>