【问题标题】:Unable to find the wrapper "feed"找不到包装“提要”
【发布时间】:2011-07-21 13:43:21
【问题描述】:

我遇到了一个问题,导致我的一个项目停止了,我在谷歌上搜索了几天,但没有找到任何对我有意义的东西(这是我的第一个 PHP 项目)。我正在使用 CodeIgniter 和 CI wiki 中提供的 RSSParser 库。一切都被调用/加载得很好,但我遇到了我“认为”的流包装问题。这是我在 CI 论坛上发布的帖子 (http://codeigniter.com/forums/viewthread/184223/) 以供参考。基本上我收到的错误是这样的:

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: libraries/RSSParser.php

Line Number: 89

这是“RSSParser.php”来源的另一个链接

问题代码如下:

<?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;    
?>  

我认为发生这种情况的原因是“feed://”没有注册为 PHP 流,并且 RSS 解析器无法找到和检索我从提要中请求的信息。我需要帮助的是弄清楚如何注册包装器“feed://”。

*注意我正在使用 MAMP

【问题讨论】:

    标签: php codeigniter stream wrapper feed


    【解决方案1】:

    【讨论】:

    • 查看我在 CI 论坛 codeigniter.com/forums/viewthread/184223/#871735 上发布的帖子,并注意我遇到的错误;我也不知道怎么解决。
    • 这最终解决了它。将简单的饼图和 MAMP 上传到我的虚拟主机提要后,我遇到了问题,并且 http 都可以正常工作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多