我用file_get_contents
函数来获取URL转换为字符串:的file_get_contents():没有这样的主机是已知的错误
$contents = file_get_contents("http://google.com");
不过,我收到以下错误:
file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: No such host is known.
我如何解决这个在我的本地主机?
我认为这可能是DNS或防火墙问题。你可以检查你是否可以从该主机ping“google.com”? – RaYell 2009-08-14 07:23:21