1
votes

i am having a problem with PHP file_get_contents.

$html = file_get_html($csfd_link);

Writes an error:

Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/vo003500/www_root/admin/simple_html_dom.php on line 76

Warning: file_get_contents(http://www.example.com/) [function.file-get-contents]: failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/vo003500/www_root/admin/simple_html_dom.php on line 76

I do not know what it is. The server is allow_url_fopen ON

Thanks

Edit: Until now it worked, but the last 2 weeks not working...

1
It means it cannot translate a DNS name into an IP.... - Wrikken
What is in the variable $csfd_link? You'll probably find it's not a valid file name or URL. - user1864610

1 Answers

2
votes

It looks like your suffering from DNS (Domain Name Service) resolution error. Make sure there is a proper DNS server entry in /etc/resolv.conf.