If i try to run the following:
<?php echo file_get_contents("http://www.yahoo.com/index.html"); ?>
through the web server I get a an "
php_network_getaddresses: getaddrinfo" error.
If I run the same file from the shell with:
then I get the expected file output.
This indicates to me that the 'nobody' user, which the webserver runs as, is not able to resolve the domain name, but the shell user can.
Any ideas on how to fix this?
Further info: CentOS 6, cPanel install, Apache, PHP running as dso.
BTW, I've tried disabling the firewall to no effect.
[SOLVED] - when I found that gethostbyname() was working, I realised that it was some internal caching problem. A server restart seems to have sorted out the problem.