首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >codeigniter simplepie

codeigniter simplepie
EN

Stack Overflow用户
提问于 2009-10-28 07:05:39
回答 2查看 1K关注 0票数 0

我想提一下,我有简单的工作在我的开发环境,但一旦我上传的网站,我不能得到饲料到我的主页。有什么想法吗?下面是在localhost上工作的代码:

代码语言:javascript
复制
function Homepage()
{
   parent::Controller();
   $this->base = $this->config->item('base_url');
   $this->css = $this->config->item('css');
   $this->images = $this->config->item('images');
   $this->load->library('simplepie');
   $this->simplepie->set_feed_url('http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml');          
   $this->simplepie->set_cache_location(APPPATH.'cache/rss');
   $this->simplepie->init();
   $this->simplepie->handle_content_type();
}

function index()
{
  $data['rssdata'] = array(
    "title" => $this->simplepie->get_title(),
    "description" => $this->simplepie->get_description(),
    "items" => $this->simplepie->get_items(0,5)
    );
    $this->load->view($data)
}

this is the code that is in the view:

 <h3 class="ui-widget-header"><?= $rssdata['title']?></h3>
<div id="accordion" >
<div>
<h5><?= $rssdata['description']?></h5>
<p><?php foreach($rssdata['items'] as $item) :?>
<ul>
<li><?php anchor($item->get_link(),$item->get_title());?></li>
<li class="rssfeed"><?php echo $item->get_description();?></li>
</ul>
<p><small>Posted on <?php echo $item->get_date('j F Y g:i a');?></small></p>
<?php endforeach;?>
</div>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-01-11 19:11:06

使用他们的GitHub配置文件中最新的“前沿”,它解决了PHP5.3的几个问题,这些问题使Apache从太多的错误中爆炸。

在编写本文时,最前沿被标记为v1.2.1-dev

票数 2
EN

Stack Overflow用户

发布于 2009-10-28 08:44:09

我曾经遇到过这个问题,当时我的主机设置没有安装cURL,而error_reporting关闭了...

尝试在SimplePie配置文件中将var $force_fsockopen = false;设置为var $force_fsockopen = true;,看看是否有所不同

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1634183

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档