views:

38

answers:

2

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?

+1  A: 

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

Jack Webb-Heller
PHP 5.3.1, running locally on Mac OS 10.6.4 (using XAMPP). I haven't had a chance to upload to my server and see if it works remotely (most of the stuff I read online seemed to indicate that switching OS's often did the trick). Does that info help at all?
tchaymore
Well, I uploaded the script to my server and it runs just fine. Wish I knew what the issue was locally because that would make revisions a lot easier.
tchaymore
+1  A: 

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

kitsched