无法让 simplepie 在 XAMPP / Mac OS X 上与 Codeigniter 一起使用
我正在尝试将 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这似乎是与 XAMPP 相关的问题。遇到同样的问题,换成MAMP就解决了。
This seems to be an issue related to XAMPP. Had the same problem, switched to MAMP and that solved it.
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 withphpinfo();
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