Unable to find the wrapper "feed"
I'm running into a issue that has brought a project of mine to a halt and I've googled over a couple days and haven't found anything that makes sense to me (this is my first PHP project). I'm using CodeIgniter and an RSSParser library that was available in the CI wiki. Everything is being called/loaded fine but I'm running into what I "think" is a stream wrapper problem. Here is a post (http://codeigniter.com/forums/viewthread/184223/) I made on the CI forums for reference. Essentially the error that I am recieving is this:
Severity: Warning
Message: file_get_contents() [function.file-get-contents]: Unable to find the wrapper "feed" - did you forget to enable it when you configured PHP?
Filename: librari开发者_如何学Pythones/RSSParser.php
Line Number: 89
Here's another link to the source for 'RSSParser.php'
The problem code is below:
<?php
//Load the shiny new rssparse
$this->load->library('RSSParser',array('url' => 'feed://api.flickr.com/services/feeds/photos_public.gne?id=30842919@N04&lang=en-us&format=rss_200', 'life' => 2));
//Get six items from the feed
$data = $this->rssparser->getFeed(6);
foreach ($data as $item) :
// do stuff with $item['title'], $item['description'], etc.
echo '<h2>' . $item['title'] . '</h2>';
echo '<abbr>' . $item['date'] . '</abbr>';
echo $item['image'];
endforeach;
?>
The reason I believe that this is happening is that "feed://" isn't registered as a PHP Stream and the RSS Parser is unable to find and retrieve the information that I am requesting from the feed. What I need help with is figuring out how to register the wrapper "feed://".
*note I'm using MAMP
Why not just use http?
http://api.flickr.com/services/feeds/photos_public.gne?id=30842919@N04&lang=en-us&format=rss_200
works just fine for me.
精彩评论