急问:fsockopen函数提示php_network_getaddresses错误
提示的出错信息如下:
<br />
<b>Warning</b>: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in <b>/home/www/tmp_test/socket.htm</b> on line <b>2</b><br />
<br />
<b>Warning</b>: fsockopen(): unable to connect to www.php.net:80 in <b>/home/www/tmp_test/socket.htm</b> on line <b>2</b><br />
Resource temporarily unavailable (11)<br>
程序是php官方帮助的例程,如下:
<?php
$fp = fsockopen ("www.php.net", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\nHost: www.php.net\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
?>
系统的运行环境如下:
PHP Version 4.3.4
System Linux datagather 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686
Build Date Aug 6 2004 18:10:13
Configure Command './configure' '--with-gd=/usr/local' '--with-mysql=/usr' '--with-apache=../apache' '--enable-ftp' '--enable-track-vars'
Server API Apache
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/Zend/etc/php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20021010
Debug Build no
Thread Safety disabled
Registered PHP Streams php, http, ftp
请问这是什么问题造成的,谢谢