views:

463

answers:

4

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer.

I am trying to make use of SimplePie.

I followed all the instructions I could find: a copy of simplepie.inc is in my applications/libraries folder, renamed to simplepie.php I enabled curl on Apache. I attempt to load SimplePie as follows:

this->load->library('simplepie');

At this point, Apache hangs. The error log has not real errors - just an indication that it is listening at port 443 and port 80. Then I get a messagebox from Apache saying that it has been stopped for an unknown error.

I suspect that it must be a combination of the three tools, most likely related to XAMPP, because there are many codeigniter/simplepie tutorials that seem to work for other people.

Does anyone have any ideas of the issue? If not, has anyone tried Magpie with CodeIgniter? I'm thinking of trying it because I'm getting rather desperate.

A: 

You can use Haughin's Library here: I have used it in the past and works great!

http://www.haughin.com/code/simplepie/

quote from the page:

In your controllers, simply load the library, set your feed url.. and you’re away!

$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();

Then, to use the feed data:

    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>";
Thorpe Obazee
this is exactly what I used. Everyone refers to this and it's the top of the google search. the problem I am having is that Apache hangs on the first line - loading simplepie itself. (I am able to run this on a server that has Linux, but not on my Windows computer.)
sql_mommy
Hmm.. I've never had any problem with it. Could there be something else that's causing the hang?
Thorpe Obazee
I have several questions for you that might help me find the answer: are using using XAMPP? Which version? Are you using Windows? Which OS? Which version of PHP? etc. I wonder if it's a bug in the specific Windows distribution of Apache that comes in XAMPP.
sql_mommy
A: 

I am also facing the same issue????

Ajay
I'm beginning to think it might be related to Windows. It worked for us on a Linux machine. Perhaps it's the Apache in XAMPP for Windows? Just a guess. Let me know if you get any conclusion. Right now we have decided to do our development on our production server, which is Linux, ignoring our Windows machines.
sql_mommy
It does work on Linux machine...wish it could work on windows :(
Ajay
+1  A: 

I tried posting this last night but had problems with my internet, sorry.

Elliot's library is mainly a wrapper around version 1.2 of SimplePie that is not compatible with PHP 5.3. The reason this matters is that there are SO MANY deprecated errors being thrown, sometimes Apache just gives up (it's happened to me).

To solve this, use SimplePie 1.2.1-dev from their GitHub repository which works fine with PHP 5.3.

http://github.com/rmccue/simplepie/

Phil Sturgeon
I will look into this, thanks. it was for a school project that is over now - we just developed on the server. but i will test this on my machine. thanks again!
sql_mommy