1. bluehost knowledge base

PHP PECL Packages

PECL acts as a repository for PHP Extensions, providing you with a directory of all known extensions and hosting facilities for downloading and development of PHP extensions.

Viewing Currently Installed PECL Packages

To view the PECL Packages currently installed, you will need ssh access.

If you need to enable SSH access please see our article, SSH Access.

Once you have logged in via SSH, enter the following command:

/usr/bin/pecl list

Please note: this will only work for accounts using the 'Legacy' user-interface. For 'Bluerock' accounts, you must call one of the specific easyapache PHP installations of PECL in order for these instructions to work.

For more information on the differences between Legacy and Bluerock accounts, please see Bluerock vs Legacy.

Installing New PECL Package

You can download and install PECL packages locally to your account. You'll need SSH access.

If you need to enable SSH access please see our article, SSH Access.

Once you're logged in, these are steps for installation:
  1. Create a folder in your home directory to download and compile the packages in.

    mkdir ~/pecl

  2. Create a directory for you php extensions to be located in. Something like ~/php/extensions.

    $ mkdir ~/php ) $ mkdir ~/php/extensions

  3. Change directories to that created pecl directory and run the following command:

    cd ~/pecl pecl download <packagename> ********************** For multiple PECL packages, repeat steps 4-9 and then step 12 *****************

  4. That will download the package which you'll then need to untar with: tar -xvzf
  5. Change directories to the extracted directory and run the phpize command

    cd ~/pecl/<packagedirectory> phpize

  6. When that's done, run the following command from inside the module folder ./configure --prefix=$HOME/pecl/<packagedirectory> ( you can find the directory to use by typing pwd inside the package directory)

    cd ~/pecl/<packagedirectory> ./configure --prefix=$HOME/pecl/<packagedirectory>

  7. If that runs without error, then the package should be compatible with our environment. If it completes successfully, run the following command from individual module directory make

    make

  8. That will create the module file that you'll need to put in your php.ini. It'll be located in the modules directory and will be named <packagename>.so

    cd modules

  9. Copy the .so file to your ~/php/extensions directory that you created.

    cp <packagename>.so ~/php/extensions

  10. Copy the existing server-installed extensions from /usr/lib64/php/modules/ to the ~/php/extensions directory:

    cp -rf /usr/lib64/php/modules/* ~/php/extensions/

  11. Edit your php.ini file in public_html (assuming you're on single php.ini mode from the php config icon in the cpanel) and change the extension_dir setting to the full path to your ~/php/extensions directory

    extension_dir = "/home<#>/<username>/php/extensions"

  12. Add the extension to your php.ini file. It'll look like: extension=<filename>.so