title: "failed to open stream: Connection timed out" even though the remote site is up and running
body: <p>I am testing a PHP script to scrape a remote site using the Simple HTML DOM Parser library. The code used to work fine; however, it suddenly stopped today.</p>
  
  <pre><code>&lt;?php
  
  require_once 'backend/connector.php';
  require_once 'table_access/simplehtmldom_1_5/simple_html_dom.php';
  ini_set("display_errors", 1);
  error_reporting(E_ALL);
  echo file_get_html("http://www.google.com");
  
  ?&gt;
  </code></pre>
  
  <p>The error it's giving is:</p>
  
  <blockquote>
    <p>Warning:
    file_get_contents(<a href="http://www.google.com" rel="nofollow noreferrer">http://www.google.com</a>):
    failed to open stream: Connection timed out in
    /home/peppyoil/public_html/sandboxassets/engines/table_access/simplehtmldom_1_5/simple_html_dom.php
    on line 75</p>
  </blockquote>
  
  <p>I don't understand why it's timing out repeatedly despite the remote site being very much available when accessed through the browser. I would understand it it said connection refused or something like that but what could possibly explain the timing-out?</p>
  
  <p>I tried using cURL:</p>
  
  <pre><code>&lt;?php
  
  $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, 'http://www.google.com');
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt($ch, CURLOPT_PROXY, $proxy); // $proxy is ip of proxy server
   curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
   curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
   curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
   curl_setopt($ch, CURLOPT_TIMEOUT, 10);
   $httpCode = curl_getinfo($ch , CURLINFO_HTTP_CODE); // this results 0 every time
   $response = curl_exec($ch);
   if ($response === false) $response = curl_error($ch);
   echo stripslashes($response);
   curl_close($ch);
  
   ?&gt;
  </code></pre>
  
  <p>Didn't work this time either threw the following error instead:</p>
  
  <blockquote>
    <p>Connectiontimed out after 10001 milliseconds</p>
  </blockquote>
  
  <p>The test script given above is sitting at <a href="http://www.peppyburro.com/sandboxassets/engines/test1.php" rel="nofollow noreferrer">http://www.peppyburro.com/sandboxassets/engines/test1.php</a></p>
  
  <p><strong>Update 2</strong>: Just checked my port 80 and found this:</p>
  
  <blockquote>
    <p>Outbound Port 80, 443, 587 and 465 for your account are BLOCKED Reason
    for the port block: During our regular scans, we have found malicious
    files in your account which may be infected with malware.</p>
  </blockquote>
  
  <p>Could this have anything to do with the timeouts?</p>