February 13, 2006

PEAR installation on a shared host

A web host a client is using (who shall remain nameless) has been messing things up for us. Long story short, I needed to install my own copy of PEAR on the server, without SSH access, and without being able to use the [methods described] in the PEAR manual, because none of them worked for me.

I looked to see if anyone else faced the same problems, and I didn’t turn up anything, but I did find this article that describes a way for people who don’t have access to PEAR, and are afraid of installing it the usual way, can get into it. John offers a ZIP file with his PEAR files that you can upload to your server and use after a quick edit to your include_path.

I didn’t want to use anyone else’s files, but this did provide the insight I needed to get a manual installation working. As of this writing, when you install PEAR, you get a variety of directories: data, docs, php, tests, as well as several regular files. To install these on an uncooperative server, just copy the contents of the php folder to a directory on your server, and point your include_path directive to it, as John mentions on his page.

For the sake of posterity, I’ll also mention the reasons I couldn’t use the regular PEAR installation methods.

  1. The host doesn’t allow SSH access.
  2. I can’t install outside the webtree, because the host is using PHP’s open_basedir restriction. In their case, nothing outside the web directory can be read by PHP.
  3. I tried using the PEAR 1.4 remote installation instructions involving Net_FTP, but for some reason my local installation was not being mirrored remotely. If there’s an error log describing what went wrong, I couldn’t find it.
  4. Using the web-based installation with go-pear.php isn’t supported under PEAR 1.4 right now. I tried it anyway, and it worked until the package files had to be decompressed. PEAR wasn’t able to create a temporary directory in which to extract the files.
  5. The PEAR manual no longer contains the manual installation instructions. Apparently the directory structure has become more complicated in recent versions, and simply downloading the .tar.gz files of the various packages is not a Good Idea.

All in all, it wasn’t a very pleasant experience, but at least now the website is working with our own copy of the files. The web host we’re using is fine, but their setup is hamstrung, in my opinion, by their over-reliance on the control panel software driving their shared hosting. I could fix this problem easily myself, but I don’t have access to the configuration files.

Posted by Joe

Comments

Thanks for the posting, I'd almost given up but finally moved the pear files into public_html and succeeded.

Posted by: Charlie Heath at January 20, 2008 4:05 PM
Post a comment









Remember personal info?