gethostbyname acting up
| From: | Tyler Longren | Date: | Fri, 21 Jul 2000 22:26:48 +0000 |
| Subject: | gethostbyname acting up | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-7640@lists.php.net to get a copy of this message | ||
Hi everybody-
I have a bit of code here. It worked earlier today. Now, it doesn't.
Nothing in the code has changed. I put it on a remote webserver and it
works there. It WILL NOT work correctly on my box. It ALWAYS returns
"Host not found." I'm running Apache 1.3.12, with PHP 4.0.1 pl2. Any
ideas why it refuses to work now?
<?
$host = "www.fbi.gov";
$who = gethostbyname($host);
if ($who == $host) {
print "Host not found.";
}
else {
print "$who";
}
?>
Thanks,
Tyler Longren
http://foo-bar.net