Jump to content

Recommended Posts

i was trying to run the following code

<html>
<body>
<?php
$xml = simplexml_load_file('http://rss.news.yahoo.com/rss/topstories');
if (isset($xml->channel->item)) {
foreach ( $xml->channel->item as $key=>$item ) {
echo "<a href=\"{$item->link}\">{$item->title}</a><br />";
echo "{$item->description}<br /><hr />";
}
}
?>
</body>
</html>

but the errors display eventhough i set allow_url_open = on


Warning: simplexml_load_file() [function.simplexml-load-file]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\http\index.php on line 4

Warning: simplexml_load_file(http://rss.news.yahoo.com/rss/topstories) [function.simplexml-load-file]: failed to open stream: No such file or directory in C:\http\index.php on line 4

Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://rss.news.yahoo.com/rss/topstories" in C:\http\index.php on line 4


thank you
Link to comment
https://forums.phpfreaks.com/topic/10170-url-open-help/
Share on other sites

[!--quoteo(post=376062:date=May 22 2006, 10:42 AM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ May 22 2006, 10:42 AM) [snapback]376062[/snapback][/div][div class=\'quotemain\'][!--quotec--]
That's probably because you're not specifying a specific file. You're just giving it an address. Could it possibly be: $xml = simplexml_load_file('http://rss.news.yahoo.com/rss/topstories.xml'); ?
[/quote]

i have got the answers from other forums and they say it is not because of the code. it might be because
of firewall or php setting something like that. but i havent got a solution. do you have any clue about this. thank you
Link to comment
https://forums.phpfreaks.com/topic/10170-url-open-help/#findComment-38179
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.