This tutorial covers the following topics:
How to see currently installed PEAR modules
To see the currently installed PEAR modules, first you must access your account via SSH. Then, depending on the PHP version you want to see the available modules on, execute the following command:
Replace XX with the PHP version. For example to see the available PEAR modules for PHP7.0, use:
user@servername [~/public_html]# pear70 list
Installed packages, channel pear.php.net:
Package Version State
Archive_Tar 1.4.3 stable
Console_Getopt 1.4.1 stable
PEAR 1.10.5 stable
Structures_Graph 1.1.1 stable
XML_Util 1.4.2 stable
How to install an additional PEAR package?
In addition to the already installed PEAR packages you can install new ones. For example, you can add a Calendar module. To do that, first go to pear.php.net. Then in search box at the top right corner type Calendar and press the Search button.
This will show you all the Packages that have the word "calendar" inside. Click the first result - "Calendar: A package for building Calendar data structures (irrespective of output)".
You will be redirected to the package page. From there click the Download tab.
Next, click the latest version available in the Download section to start downloading the package.
Once you have the package downloaded locally, you have to extract it on your computer. This will produce a folder named Calendar-X.X.X where X.X.X is the version of the package.
Next connect to your account by FTP and create a directory named PEAR right in the home directory of your account - /home/username. Upload the Calendar directory inside the PEAR one. You should upload any other Pear packages there.
Next you should configure PHP to include the local PEAR directory. This can be done by creating a file named php.ini and pasting the following line inside it:
include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/my_cPanel_username/PEAR";
Make sure you change my_cPanel_username to your actual cPanel username. Also the first two paths (/usr/lib/php:/usr/local/lib/php) should remain so that the default PHP libraries are loaded. This php.ini file must be copied in each directory where pear packages are needed.
From this point on the Calendar Pear package will be available with the fixed path: