English 中文(简体)
Using SimplePie with CodeIgniter and XAMPP
原标题:

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.

问题回答

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/

This version of Simplepie library is not compatible with PHP 5.3. Download PyroCMS which is built on Codeigniter and uses updated version of Simplepie library for CI.

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>";




相关问题
Using SimplePie with CodeIgniter and XAMPP

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/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签