Jump to content

php_network_getaddresses: getaddrinfo failed: Name or service not known


CarbonCopy

Recommended Posts

I recently recompiled php...again....and again (22 times so far), and I've put apache in a chroot jail. Now however, my code that is supposed to take the latest feed from my blog is broken. The error is

 

Warning: simplexml_load_file() [function.simplexml-load-file]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /www/globaltrainingedge.com/pages/test.html on line 5

Warning: simplexml_load_file(http://globaltrainingedge.com/blog/?feed=rss2) [function.simplexml-load-file]: failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /www/globaltrainingedge.com/pages/test.html on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://globaltrainingedge.com/blog/?feed=rss2" in /www/globaltrainingedge.com/pages/test.html on line 5

Notice: Trying to get property of non-object in /www/globaltrainingedge.com/pages/test.html on line 7

Notice: Trying to get property of non-object in /www/globaltrainingedge.com/pages/test.html on line 7

Notice: Trying to get property of non-object in /www/globaltrainingedge.com/pages/test.html on line 7

Notice: Trying to get property of non-object in /www/globaltrainingedge.com/pages/test.html on line 8

Notice: Trying to get property of non-object in /www/globaltrainingedge.com/pages/test.html on line 8

Notice: Trying to get property of non-object in /www/globaltrainingedge.com/pages/test.html on line 8

 

and the code is

 

<?php 
$url = "http://globaltrainingedge.com/blog/?feed=rss2";
ini_set("display_errors","on");
error_reporting(E_ALL);
$xml = simplexml_load_file($url,NULL);
#print_r($xml);
$title = $xml->channel->item[0]->title;
$content = $xml->channel->item[0]->description;

echo "$content";
?>

 

I've installed webmin and bind and setup a default config. Dig and nslookup both work fine as well.

I recently recompiled php...again....and again (22 times so far), and I've put apache in a chroot jail. Now however, my code that is supposed to take the latest feed from my blog is broken. The error is

 

Warning: simplexml_load_file() [function.simplexml-load-file]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /www/globaltrainingedge.com/pages/test.html on line 5

 

I've installed webmin and bind and setup a default config. Dig and nslookup both work fine as well.

Please:

remove bind, as it brings a whole lot of security problems with itself

read mod_chroot webpage, which has solutions for both of your recent problems.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.