PHP file_get_contents() does not work after uploading to the webserver
<p>Sample code:</p>

<pre><code>$html = file_get_contents('http://www.google.com');
echo $html;
</code></pre>

<p>It works on localhost. But after uploading to the webserver, it gives me a warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution. If I replace the domain name with google's IP address, it gives a warning: failed to open stream: Connection timed out.</p>

<p>And ini_get("allow_url_fopen") return 1.</p>

<p>===<br>
Edit: Probably it is a server problem. I guess this question should be asked on serverfault.com.</p>
