Knowledge Base
MilesWeb / Domain Name & DNS Issues

Install PEAR Module

Approx. read time : 2 min

Custom Installations:

First, create a directory outside your public_html called “pear.” This folder should be world-readable and writable, which will require permissions of 777. Then, create another folder in your public_html. You can choose the name of this folder, but you may need to password-protect it to limit access to its files. For purposes of this demonstration, the folder we are creating is called “pear-abc”

How to Password-Protect a Directory

Go to http://pear.php.net/go-pear and copy the contents of that page into a Notepad file called ”

http://abc.com/pear-abc/go-pear.php This is the main installation file. From here, the only field you should need to revise is the installation prefix, which will be the absolute path to the ‘

/home/user10/pear

‘user10’ is your milesweb username. You will also want to set the php CLI path in question 11. The path to the php binary is /usr/bin/php. Once the installation is complete, you now have your own instance of Pear installed on your site. You will need to make sure to set the include path in your php scripts to reflect that of your installation, and not the one on the server:

set_include_path(‘../../pear/PEAR’ . PATH_SEPARATOR . get_include_path());

From here you can also install your own pear packages. To do this, you can create a file called “install.php” in your pear-inst directory and add this code:

include_once “../../pear/index.php”;

When you load this page in a browser (http://abc.com/pear-abc/install.php) you will see the standard PEAR installation interface, where you can install your own PEAR modules. For security purposes, you will want to set the permissions of the pear directory to 755 when you are done installing PEAR and other modules.