Reply to topic
HOWTO: Local PEAR installation on shared host
msdi


Joined: 22 Aug 2007
Posts: 5
Reply with quote
I just spent a good 2 hours trying to get a local copy of PEAR to work. Here are the steps I took, in case anyone else finds this useful. YMMV, YRMV, etc.

  1. Create a ~/pear dir and set the permissions to 777 (rwx for all). This is directory outside your htdocs directory.
  2. Download go-pear.php (from http://go-pear.org) and install it somewhere inside htdocs.
  3. Navigate to go-pear.php through a browser.
  4. Setup the paths properly (use /vservers/username instead of ~). /usr/bin/php for php4 /usr/bin/php5 for php5
  5. Install
  6. Add ~/pear/bin to your PATH. If you're not sure how to do that, or don't care, you can type out the full path to pear (~/pear/bin/pear <command>).
  7. Run pear config-show and check to see if you need to change any paths. I had to change temp_dir, download_dir, and php_ini. Use pear config-set

    • Set php_ini to ~/etc/php.ini
    • Set temp_dir to ~/tmp/pear/temp
    • Set download_dir to ~/tmp/pear/cache

  8. You should be set. Try pear install Mail to test it out.
  9. Use set_include_path(".:/vservers/username/pear/PEAR:/vservers/username/pear/lib") in your code to get access to the installed packages. Unfortunately, you can't set php directives in .htaccess (because it's CGI) and you can't edit ~/etc/php.ini (which I don't really understand).
  10. You should probably set the permissions for ~/pear to something lower

I believe that if you install pear under htdocs, you can use the pear web interface for your package management.

Installing this also installs pecl, but I have yet to get it to work properly. Still tries to install stuff to /usr/lib/php and says that I'm running php 4.3.2.
HOWTO: Local PEAR installation on shared host
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic