Install XML / Parser.php

I recently signed up for shared web hosting with godaddy using Linux and PHP 5. I want to work with multiple RSS feeds. I previously worked on Apache, however the host provided a PEAR installation. Now I have to do it myself, and I'm in unfamiliar territory. I installed PEAR PHP and was able to get rss.php in the pears directory. Now it asks for XML / Parser.php and I don't want to spend a week figuring out where and what to do. Could you please tell me where I can find this procedure, and is there any problem simply copying it to the PEAR directory from ftp?

0


source to share


4 answers


You can always just create some subfolder in your project and extract any PEAR libraries from it, these are just simple php scripts. You will need to add this folder (and subfolders) to your include path for everything to be available. This is considered bad practice because you have to manually update the PEAR libraries and stuff, but it gives you independence from your host.



+1


source


Your PEAR classes (or other libraries) can be anywhere. You just need to set the correct include paths where the script will look for the code you want. If you cannot access php.ini, you can get the include paths using a function get_include_path()

and set them withset_include_path();



0


source


I highly recommend the SimplePie parser via PEAR :: XML_Feed_Parser. Generally, the PEAR libraries are great, but they don't support a few common feed types (I believe Atom 0.3 among others). There is also very little documentation on how to use it and (clearly) how to install it.

Just include the SimplePie library and include it in your feed and everything else. It's easy to query any data you want, regardless of schema differences. It's also very fast, we use it to pool hundreds of feeds at http://www.feedscrub.com .

Hope it helps!

0


source


echo ini_get('include_path');

      

This should show you include the path to PEAR in your original host environment, from there if it's not big just wrap up all the mess with tar -cjzf devPear.tar.bz path2pear /.

Copy this tar file to GoDaddy, extract it somewhere safe ... then in .htaccess or at the starting point of your application scripts add this pear package to your include_path.

Alternatively: If you have admin rights, I believe there is a pear.php command called "installed" that shows all pear packages installed. If you also have brute admin rights in the new environment, you can go down the line by copying and pasting the names of the packages you need to crush - set the "package name".

The second one is a little cleaner, but the first one will be faster ... just accept that these packages will be effectively removed from the pear system and cannot be updated.

0


source







All Articles