I have my webserver in my DMZ, and it resolves names fine. I can ping google.com and get a response.
However, if I run the script:
<?php
$fp = fopen('http://www.google.com', 'r');
$data = fread($fp, '100000');
echo $data
?>
I get the following response:
Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /var/www/local/fcit.php on line 3
Warning: fopen(http://www.google.com): failed to open stream: Resource temporarily unavailable in /var/www/local/fcit.php on line 3
Warning: fread(): supplied argument is not a valid stream resource in /var/www/local/fcit.php on line 4
Why does the address resolution not work with PHP, but does work on the server itself?
Thomas