title: Cannot access data from external URL
body: <p>I tried to open an external url. It works fine in my local server. But when i moved to live server it showing time out error.
  When i replaced the url by a url in the same domain ,it works fine.<br>
  allow_url_fopen is ON in the server.</p>
  
  <pre><code> &lt;?php
  if ($fp = fopen('https://www.google.com/', 'r')) {
     $content = '';
     // keep reading until there's nothing left
     while ($line = fread($fp, 1024)) {
        $content .= $line;
     }
  
     echo $content;
     echo  'do something with the content here';
     // ...
  } else {
     echo 'an error occured when trying to open the specified url';
  }
  
  ?&gt;
  </code></pre>
  
  <p>Updated</p>
  
  <pre><code>  $curl_handle=curl_init();
    curl_setopt($curl_handle,CURLOPT_URL,'https://www.google.co.in/');
    curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
    curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
    $buffer = curl_exec($curl_handle);
    curl_close($curl_handle);
    if (empty($buffer)){
        print "Nothing returned from url..&lt;p&gt;";
    }
    else{
        print $buffer;
    }
  </code></pre>
  
  <p>I tried cURL too. It returns "Nothing returned from url..". But it works fine in my local and demo server.</p>