php_network_getaddresses: getaddrinfo failed: Name or service not known

Discussion in 'Server Operation' started by CarbonCopy, Aug 24, 2009.

  1. CarbonCopy

    CarbonCopy New Member

    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

    Code:
    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

    Code:
    <?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.
     
    Last edited: Aug 24, 2009

Share This Page