PHP file_get_contents () not working after uploading to web server
Sample code:
$html = file_get_contents('http://www.google.com');
echo $html;
It runs on localhost. But after uploading to the webserver, it gives me a warning: file_get_contents (): php_network_getaddresses: getaddrinfo failed: temporary failure to resolve name. If I change the domain name to google IP, it gives warning: failed to open stream: connection timed out.
And ini_get ("allow_url_fopen") returns 1.
===
Edit: This is probably a server issue. I assume this question should be asked on server.com.
+2
a source to share
2 answers