I met a very weird problem. I changed one of my site IP, restart the server, and then changed it back in several minutes later. However, after that some pages using the function file() can't work any more. They used to work well for a long time. For example. The following code should show the content of google.com:
$url = "http://www.google.com";
$content = join(, file($url));
echo $content;
It shows following error messages now:
"Warning: file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/deals/public_html/test_php.php on line 3
Warning: file(http://www.google.com): failed to open stream: Permission denied in /home/deals/public_html/test_php.php on line 3
Warning: join(): Bad arguments. in /home/deals/public_html/test_php.php on line 3"
Can anyone help me? Thanks a lot.