Installing PEAR on Your Account
SummaryPEAR is like perl's CPAN or ruby's gems. It's a means of distributing chunks of reusable code. You can read about it in greater details on the PEAR Web site. It's also now pretty easy to install on your UW Web publishing account so that you can take advantage of this code repository.
Included on this page:
Installing PEAR
These instructions assume that you're in your public_html directory.
Create a new directory in your public_html directory called "web_pear" and change to that directory.
mkdir web_pear; cd web_pear
Add some authentication to this directory.
Create an .htaccess file.
pico .htaccess
Use UW NetID authentication to protect this directory by adding the following text to the .htaccess file.
AuthType UWNetID
require user UWNetIDWhere UWNetID is your UW NetID.
Save and exit the .htaccess file.
Download the PEAR installation script.
wget http://pear.php.net/go-pear -O go-pear.php
Open a browser and go to the URL for the
go-pear.phpfile that you just downloaded:http://accountType.washington.edu/UWNetID/web_pear/go-pear.phpNote: accountType should be replaced with staff, faculty, depts, courses, or students. Use whichever of these you normally use to view your website. UWNetID will be replaced with your UWNetID.
Do the PEAR installation.
click the "Next >>" link.
On the configuration screen, delete the "/nfs/aesop##" part of the "Installation prefix" config variable.
Check the "Install those too" box.
Click the "Install" button.
Wait for the progress bars to finish.
Edit the address in your browser to remove everything after "web_pear/" and press enter.
Optional: You can remove that error at the top of the PEAR interface that says "Warning: This package management website is not protected with a password, this is a MAJOR security risk. Please read the README." In order to remove this warning, un-comment the 16th line in the
index.phpfile in yourweb_peardirectory.PEAR is installed. In order to actually use the modules that you install with PEAR, you will need to add it to your include_path.
Fix Your include_path
Make sure you're in the public_html directory.
cd ~/public_html
Copy the system php.ini file to your public_html directory.
cp /usr/local/lib/php/php.ini-dist ./php.ini
Open the php.ini file to line 458 with pico. This line is where the
include_pathvariable is set if you're using the provided php.ini file. If you're using a custom php.ini, or you've already made changes to it, theinclude_pathvariable may not be on line 458.pico +458 php.ini
Un-comment and edit the
include_pathvariable. You can find the path to your PEAR installation by using the "wwwhome" command, and adding the web_pear directory to the end of the output.Change
;include_path = ".:/php/includes"
to
include_path = ".:(the path to your PEAR installation)"
Save the php.ini file and exit pico.
