无法让 simplepie 在 XAMPP / Mac OS X 上与 Codeigniter 一起使用

发布于 2024-09-14 10:13:20 字数 1172 浏览 3 评论 0原文

我正在尝试将 SimplePie 与 Codeigniter 一起使用,但如果我尝试加载 simplepie 库,我什至无法显示要显示的视图。我已经下载了 Haughin CodeIgniter 库 (http://www.haughin.com/code/simplepie/ )并将其放入 applications/libraries 文件夹中,但没有任何效果。我有下面的代码,但它是什么并不重要——只要我尝试加载 simplepie,就不会输出任何内容。错误日志只是说:

zend_mm_heap corrupted

代码如下,从 Haughin 的网站复制。

这是我的控制器:

function index()
{
    $this->load->library('simplepie');  
    $this->simplepie->set_feed_url('http://feeds.haughin.com/haughin');
    $this->simplepie->set_cache_location(APPPATH.'cache/rss');
    $this->simplepie->init();
    $this->simplepie->handle_content_type();

    $data['rss_items'] = $this->simplepie->get_items();

    $this->load->view('chatter/ch_index', $data);
}

这是我的观点:

<?php
echo "<li>";
foreach($rss_items as $item) {
    echo "<li>";
    echo "<a href='" .$item->get_link() . "'>";
    echo $item->get_title();
    echo "</a>";
    echo "</li>";
}
echo "</li>";
?>

有什么想法吗?

I'm trying to use SimplePie with Codeigniter but I can't get even the view to display if I try to load the simplepie library. I've downloaded the Haughin CodeIgniter library (http://www.haughin.com/code/simplepie/) and put it in the applications/libraries folder, but nothing works. I have the code below, but it doesn't really matter what it is -- as long as I try to load simplepie, nothing outputs. The error log just says:

zend_mm_heap corrupted

Code is below, copied from Haughin's site.

Here is my controller:

function index()
{
    $this->load->library('simplepie');  
    $this->simplepie->set_feed_url('http://feeds.haughin.com/haughin');
    $this->simplepie->set_cache_location(APPPATH.'cache/rss');
    $this->simplepie->init();
    $this->simplepie->handle_content_type();

    $data['rss_items'] = $this->simplepie->get_items();

    $this->load->view('chatter/ch_index', $data);
}

Here is my view:

<?php
echo "<li>";
foreach($rss_items as $item) {
    echo "<li>";
    echo "<a href='" .$item->get_link() . "'>";
    echo $item->get_title();
    echo "</a>";
    echo "</li>";
}
echo "</li>";
?>

Any thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

零度℉ 2024-09-21 10:13:20

这似乎是与 XAMPP 相关的问题。遇到同样的问题,换成MAMP就解决了。

This seems to be an issue related to XAMPP. Had the same problem, switched to MAMP and that solved it.

南七夏 2024-09-21 10:13:20

zend_mm_heap 损坏 似乎被广泛报道为 PHP 版本不兼容。您使用的是哪个版本的 PHP?使用 phpinfo(); 创建一个 PHP 文件,以输出您需要的所有 PHP 信息。这是本地安装还是主机上?

请参阅http://bugs.php.net/bug.php?id=40479

zend_mm_heap corrupted seems to be widely reported as a PHP version incompatibility. Which version of PHP are you using? Create a PHP file with phpinfo(); in to output all the PHP information you need. Is this a local install, or on a host?

See http://bugs.php.net/bug.php?id=40479

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文