Installing PEAR

First you must authenticate as root, then enter the following command to retrieve the pear installation script:

$ wget http://pear.php.net/go-pear -O go-pear.php

You may now have to change the files permissions in order to execute it:

$ chmod 0100 go-pear.php

Now finally we may execute the php file:

$ php -q go-pear.php

The installer will now run (once you press enter) and a few questions will be asked, you most likely will simply press enter to skip the proxy settings. Then you will be asked to choose an installation structure, you should probably prefix the installation to your users name (root) so it may look similar to:

1. Installation prefix ($prefix) : /root
2. Temporary files directory     : $prefix/temp
3. Binaries directory            : $prefix/bin
4. PHP code directory ($php_dir) : $prefix/PEAR
5. Documentation base directory  : $php_dir/docs
6. Data base directory           : $php_dir/data
7. Tests base directory          : $php_dir/tests

Once the installation is completed you will be asked to alter php.ini select yes (Y), the script will now alter the include_path to /root/PEAR or the appropriate location that you choose.

I would personally verify this change by using $ whereis php and reading php.ini like so:

$ cat /etc/php.ini | more

You should see something similar to:

;***** Added by go-pear
include_path=".:/root/PEAR:"
;*****

You can now view pears configuration using $ pear config-show and $ pear help for additional information, as well as $ pecl help for installing PECL extensions.

Enjoy!