URL Posted June 25, 2009 Share Posted June 25, 2009 I'm attempting to read an xml document URL in php, but I keep getting this error: Warning: simplexml_load_file() [function.simplexml-load-file]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\Program Files\EasyPHP 3.0\www\test.php on line 42 Warning: simplexml_load_file(http://isbndb.com/api/books.xml?access_key=6GACLX6U&index1=isbn&value1=9780966807707) [function.simplexml-load-file]: failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\Program Files\EasyPHP 3.0\www\test.php on line 42 The page exists, and I can see the xml document when I open the url, but my program seems unable to find it. Here's the section of code: $isbn = $row['ISBN']; $completeurl = "http://isbndb.com/api/books.xml?access_key=6GACLX6U&index1=isbn&value1=" .$isbn; $xml = simplexml_load_file($completeurl, 'SimpleXMLElement', LIBXML_NOCDATA); $tracks = $xml->ISBNdb->BookList->BookData; Quote Link to comment https://forums.phpfreaks.com/topic/163623-php_network_getaddress-failed/ Share on other sites More sharing options...
JonnoTheDev Posted June 25, 2009 Share Posted June 25, 2009 Has your php server got an outbound internet connection? Is DNS setup properly on it? Ping the domain isbndb.com from your server. Quote Link to comment https://forums.phpfreaks.com/topic/163623-php_network_getaddress-failed/#findComment-863447 Share on other sites More sharing options...
URL Posted June 25, 2009 Author Share Posted June 25, 2009 Hmm, ping says cannot find host isbndb.com. Is that a setting on isbndb.com or is it a problem on my end? My computer is connected to the internet via a local LAN. Quote Link to comment https://forums.phpfreaks.com/topic/163623-php_network_getaddress-failed/#findComment-863454 Share on other sites More sharing options...
URL Posted June 25, 2009 Author Share Posted June 25, 2009 Turned out I needed a @ before the simplexml_load_file. Quote Link to comment https://forums.phpfreaks.com/topic/163623-php_network_getaddress-failed/#findComment-863607 Share on other sites More sharing options...
JonnoTheDev Posted June 25, 2009 Share Posted June 25, 2009 @ will just surpress the error Quote Link to comment https://forums.phpfreaks.com/topic/163623-php_network_getaddress-failed/#findComment-863765 Share on other sites More sharing options...
HardlyWorking Posted July 28, 2009 Share Posted July 28, 2009 So I've noticed...I'm trying to use http://ecs/aazonaws.com instead, but I get the same error. Quote Link to comment https://forums.phpfreaks.com/topic/163623-php_network_getaddress-failed/#findComment-885007 Share on other sites More sharing options...
JonnoTheDev Posted July 28, 2009 Share Posted July 28, 2009 If your server cannot ping a website's IP address i.e. 87.58.96.33 (example) then your server has no internet connection. If it can ping public IP addresses then your DNS settings are invalid. Quote Link to comment https://forums.phpfreaks.com/topic/163623-php_network_getaddress-failed/#findComment-885023 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.