Error with fopen: php_network_getaddresses getaddrinfo

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mwesterm
Forum Newbie
Posts: 1
Joined: Thu Apr 21, 2005 5:45 am

Error with fopen: php_network_getaddresses getaddrinfo

Post 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 :-)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
Post Reply