Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Install PHP pear package in WHM/cPanel.  (Read 7987 times)

0 Members and 1 Guest are viewing this topic.

Chetan Singh

  • Full Member
  • ***
  • Posts: 123
  • Karma: +2/-0
  • Bienvenido a las Tecnologías de la Admin-Ahead.
    • Admin-Ahead Server Technologies.
Install PHP pear package in WHM/cPanel.
« on: October 27, 2013, 12:27:03 am »
Hello,

You can install PHP pear packages on your own. There are various methods to do so.

Many PHP PEAR packages are already included with cPanel. Click on the PHP PEAR Packages icon in the cPanel then click on "Show System Installed Modules". If the extension required is not listed, below are two options for installing PHP PEAR Packages.

1)Installing PHP PEAR Packages included with cPanel:

The cPanel includes a selection of PEAR Packages which can automatically be installed. Simply follow these steps to use the cPanel's PEAR Package installer.

Click on the PHP PEAR Packages icon in the cPanel.
Use the search box or click the button to show all available PEAR extensions.
Click the install button next to the extension you wish to install to your account.
Follow the php.ini configuration steps shown below.

2)Manually installing PHP PEAR Packages:

If the PEAR Package is not already installed and is not available to install via the cPanel, you may install the package manually by following these steps:

Download the PEAR package from the internet, often this will be from pear.php.net.
Upload the file to the home directory inside the php folder. If the php folder does not already exist in the home directory, simply create one.
Extract the file (if needed).
Follow the php.ini configuration steps shown below.

3)Configuring the php.ini file for installed PEAR Packages:

In order for scripts to use the PEAR package(s) that have installed with either of the above methods, make sure the php.ini file references the correct php/ directory.

Open the php.ini file with a standard text editor or code editor. You may use the file manager edit tool.

Locate the line which begins with include_path. It should look similar to:

include_path = ".:/usr/lib/php:/usr/local/lib/php"
(if this line begins with a semicolon, remove the semicolon)

Change this path to include the path of your php folder (separated by a colon). For example:

include_path = ".:/usr/lib/php:/usr/local/lib/php:/home#/username/php"
Where /home#/username/ is the home directory for your account as shown in the main cpanel page on the left stats column.


Note: If you still are unable to use the PHP PEAR package after following these steps, ensure you have modified the php.ini file which is in the same directory as your PHP script. Alternatively you may modify the php.ini file in public_html and have chosen single php.ini from the PHP Config icon in the cPanel. The single php.ini option indicates that all PHP scripts should use the php.ini file found in public_html.

Thank you,
Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!