SimplePie is a PHP library that can fetch, cache, parse, and normalize RSS and Atom feeds. It allows you to display the newest articles from websites with RSS or Atom feeds on your own site. This is a great way to add new, fresh, and relevant information to your site. This guide shows how you can set it up for your own web site.
I want to set up SimplePie in a subdirectory of my document rootÂ /var/www/web1/web calledÂ simplepie so I create it as follows (together with aÂ cache directory that SimplePie needs for caching feeds):
Then I change the ownership of theÂ simplepie directory and its subdirectories and make theÂ cache directory world-writable:
Next I download SimplePie to theÂ /var/www/web1 directory (make sure you grab the latest version fromÂ http://simplepie.org/downloads/?download):
To unpack it, we need the unzip tool. If it’s not installed, install it now (on Debian/Ubuntu, you can do it as follows:
Now let’s unzip SimplePie and move the contents of the package to ourÂ /var/www/web1/web/simplepie directory:
TheÂ compatibility_test directory contains a test to check if your server fulfills all requirements – basically what we’ve done with theÂ phpinfo() function already in chapter 1.
TheÂ demo directory contains a working SimplePie demo (it uses its own cache directory therefore we must make this world-writable as well).
The only file we actually need to run SimplePie isÂ simplepie.inc – that’s the SimplePie library.
Let’s remove the SimplePie directory and zip file afterwards to clean up our system:
SimplePie is now set up and ready to be used.