【问题标题】:codeigniter simplepie代码点火器简单派
【发布时间】:2009-10-27 23:05:38
【问题描述】:

我想提一下,我有 simplepie 在我的开发环境中工作,但是一旦我上传了网站,我就无法将提要进入我的主页。有任何想法吗?这是适用于 localhost 的代码:

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>

【问题讨论】:

  • 库也上传了吗?
  • 已上传。这真的让我失望吗?请问有什么线索吗?
  • 如果代码在 dev 而不是 prod 环境中工作,则问题不在代码中。 prod 环境中是否有错误抑制?如果是这样,请尝试输出一些错误,它们应该会为您提供有关问题所在的线索。
  • 感谢弗兰基会尝试一下,看看会出现什么。将在此处发布显示的内容,以便“GUYS” PLEEEAAASE 继续查看。

标签: codeigniter simplepie


【解决方案1】:

使用他们 GitHub 个人资料中最新的“前沿”,它解决了 PHP 5.3 的几个问题,这些问题导致 Apache 因太多错误而爆炸。

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

【讨论】:

    【解决方案2】:

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

    尝试在 SimplePie 配置文件中将 var $force_fsockopen = false; 设置为 var $force_fsockopen = true; 看看是否有影响

    【讨论】:

    • 嗨,ekhaled,按照你的建议做了,什么也没做。错误抑制是我认为搞砸了我能做的事情。不过,我会保留插件,看看会发生什么
    猜你喜欢
    • 1970-01-01
    • 2012-02-09
    • 2011-06-04
    • 2016-01-28
    • 2012-06-30
    • 2012-02-21
    • 2011-03-29
    • 2011-08-06
    • 1970-01-01
    相关资源
    最近更新 更多