Page 1 of 1

Error with fopen: php_network_getaddresses getaddrinfo

Posted: Thu Apr 21, 2005 5:54 am
by mwesterm
Hello,

maybe someone can give me a little hint:

This is my script

Code: Select all

<?php
$fd=fopen("http://www.heise.de","r");
fclose($fd);
?>

And this is the result:
fopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in
/var/www/internet-test/demo.php on line 2
System is a debian, nslookup/ping/dns-resolution works fine (ping ok, curl ok).
PHP.INI is ok (allow_url_fopen = on).

What else can be wrong?

Thnks

Martin

d11wtq | Please read the notes about posting code in the forums :-)

Posted: Thu Apr 21, 2005 6:17 am
by Chris Corbyn
Some servers reject requests from fopen() or file_get_contents() beacuse they do not have any browser info to look at.

fsockopen() Can send anything you request to the server. i.e. You can specify the User-Agent: header in the HTTP request.

If you have access to cURL then you that instead though.