PEAR (PHP Extension and Application Repository) packages are reusable PHP code libraries that can greatly simplify web site development. There are PEAR packages for interacting with databases, handling e-mail, processing XML, and much more.
Before you try to install a PEAR package, make sure it is not already installed. For example, our shared hosting servers already have several PEAR packages that are pre-installed systemwide. To see which PEAR packages are currently available for your web account, log in using SSH and then type the following command:
pear list
If the PEAR package that you want is not listed, then you can install it using one of the following methods.
If your A2 Hosting account includes cPanel, you can use it to install PEAR packages. For information about how to install PEAR packages using cPanel, please see this article.
After the PEAR package is installed, you must configure the PHP include path. To do this, follow this procedure.
If you have installed PEAR packages before on other systems, you may have used the pear install command. However, this command requires superuser access, which is not available on shared hosting accounts. If you are unable to install a PEAR package using cPanel, an A2 Hosting administrator can install it for you. If you need further assistance, please open a support ticket with our Guru Crew on the Customer Portal at https://my.a2hosting.com.
After the PEAR package is installed, you must configure the PHP include path. To do this, follow this procedure.
After you install a PEAR package for the first time using one of the methods above, you must configure the PHP include path. Otherwise, your PHP script files will be unable to locate the PEAR packages that you installed. After you configure the PHP include path, you do not need to do so again for subsequent PEAR package installations.
To configure the PHP include path:
include_path
Add the PHP extension path. For example, if the existing line is:
include_path = ".:/usr/lib/php:/usr/local/lib/php"
Change the line to:
include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/USERNAME/php"
For more information about PEAR packages, please visit http://pear.php.net.
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.