Jump to content

php_network_getaddress failed


URL

Recommended Posts

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;

Link to comment
https://forums.phpfreaks.com/topic/163623-php_network_getaddress-failed/
Share on other sites

  • 1 month later...

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.