Magento インストールで SimplePie を使用して、数か月間問題なくブログ投稿をホームページに取り込んでいます。Magento のその他の問題により、Web ホストで APC のオペコードをオフにしました。これを行うと、SimplePie の次の 1 時間ごとの更新でホームページの読み込みが停止し、Apache で次のエラーが返されます。
[2012 年 1 月 18 日水曜日 09:59:57] [エラー] PHP 致命的なエラー: クラス 'Zend_Log' が {server root}/lib/SimplePie/simplepie.inc の 738 行目に見つかりません
何が起こっているのか、それを修正するために何をすべきかについて、私は少し途方に暮れています。SimplePie はバナー/ウィジェットとして配信されるため、別のカテゴリ ページに配置しても同じ結果が得られます。(SimplePie コマンドでページが停止します) 変更により、古いキャッシュされた RSS が強制的に残され、変更できなくなるような単純なものになることを望んでいましたが、よくわかりません。
どんな助けでも大歓迎です!
SimplePie のコードは変更されておらず、バージョン 1.2.1 です。次のコードを持つページ /app/design/frontend/default/default/template/page/html/blog.phtml があります。
<div class="col-narrow right sidebar-blog">
<h2>Our Gardening Blog</h2>
<?php
// Make sure SimplePie is included. You may need to change this to match the location of
require_once('lib/SimplePie/simplepie.inc');
// We'll process this feed with all of the default options.
$feed = new SimplePie();
// Set which feed to process.
$feed->set_feed_url('http://blog.americanmeadows.com/feed/');
// Run SimplePie.
$feed->init();
// This makes sure that the content is sent to the browser as text/html and the UTF-8
$feed->handle_content_type();
/*
Here, we'll loop through all of the items in the feed, and $item represents the
current item in the loop.
*/
foreach ($feed->get_items(0,2) as $rss_item):
?>
<div class="article-teaser">
<p><span><?php echo $rss_item->get_date('F j, Y'); ?></span></p>
<h2 class="article-title"><a href="<?php echo $rss_item->get_permalink(); ?>"><?php echo $rss_item->get_title(); ?></a></h2>
<?php if ($rss_item->get_item_tags('', 'thumbnail')) {$thumbnail = $rss_item->get_item_tags('', 'thumbnail'); echo "<img src='" . $thumbnail[0]['data'] . "'>"; } ?>
<p><?php echo $rss_item->get_description(); ?> <a class="more" href="<?php echo $rss_item->get_permalink(); ?>" target="_blank">Continue Reading</a></p>
</div>
<?php endforeach; ?>
</div>
次に、次のみを呼び出すバナーがあります
{{block type="page/html" template="page/html/blog.phtml"}}
ホームページの左側の列のウィジェットにそのバナーを含めて表示します。
SimplePie の行はエラーをスローしています
function SimplePie($feed_url = null, $cache_location = null, $cache_duration = null)
{
// Other objects, instances created here so we can set options on them
$this->sanitize =& new SimplePie_Sanitize; /* Error is thrown here */
// Set options if they're passed to the constructor
if ($cache_location !== null)
{
$this->set_cache_location($cache_location);
}
それがあなたが必要としているものだと思いますが、もっと投稿していただければ幸いです。