質問

言及したいのは、開発環境で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>
役に立ちましたか?

解決

最新の「裁ち落としエッジ」を使用するGitHubプロファイルから、Apacheが非常に多くのエラーから爆発する原因となったPHP 5.3のいくつかの問題を整理しています。

執筆時点では、最先端は v1.2.1-dev 。

他のヒント

この問題は、ホスティング設定にcURLがインストールされておらず、error_reportingがオフになっていたときに一度発生しました。

SimplePie構成ファイルで var $ force_fsockopen = false; var $ force_fsockopen = true; に設定して、違いが生じるかどうかを確認してください

scroll top