I recently signed up to shared web hosting with godaddy using Linux and PHP 5. I want to work with multiple RSS feeds. I previously had this all functioning under Apache, however, the host supplied the PEAR installation. Now I have to do this myself and I am in unfamiliar territory.I installed PEAR PHP and managed to get rss.php in the pear directory. It now asks for XML/Parser.php and I do not want to spend another week finding where and what to do. Can you please inform me where i can find this routine and whther there is any problem in just copying it into the PEAR directory with ftp?
You can always just create some subfolder in your project and extract any PEAR libraries directly there, it's just plain php scripts. You will have to add that folder (and subfolders) to your include path so everything will be accessible. It is considered as a bad practice because you will have to manually update PEAR libraries and stuff, but it gives you independence from your hoster.
Thanks for the reply, i am still not sure where to get the relevant Parser.php that the RSS.PHP requires. Can you assist on this?
Your PEAR (or other libraries) classes can be anywhere. You just need to set correct include paths where script will search for required code. If you can't access php.ini, you can get include paths by using get_include_path()
function and set them using set_include_path();
I highly recommend SimplePie feed parser over the PEAR::XML_Feed_Parser. Usually the PEAR libraries are great but they don't support several common types of feeds (I believe Atom 0.3 among several others). Also there is very little documentation about how to use it and (clearly) how to install it.
Simply include the SimplePie library and point it at your feed and it does the rest. It's easy to query for any data you want regardless of schema differences. It's also very fast, we're using it to aggregate hundreds of feeds over at http://www.feedscrub.com.
Hope that helps!
echo ini_get('include_path');
This should show the include the path to PEAR on the original host environment, from there if its not to big just wrap the entire mess up with tar -cjzf devPear.tar.bz path2pear/ .
Copy this tar file over to GoDaddy, extract to a safe location... then in .htaccess or at the start point of your application scripts, add this pear package into your include_path.
Alternatively: If you have administrative rights, I believe there is a pear.php command called "installed" that shows all installed pear packages. If you also have pear administrative rights on the new environment, you can go down the line doing copy and paste of the package names you need to pear --install "package" name.
The second is a little cleaner, but the first will be faster... just accept these packages will be effectively stranded from the pear system and unable to be updated.