How to Install PHP PECL Extensions

PECL extensions are third-party compiled extensions for PHP.

Install the Compiler

As PECL extensions are compiled programs, you must first install a compiler and related tools and libraries. To install the compiler, run the following command on your server as root.

sudo apt-get -y install gcc make autoconf libc-dev pkg-config

Installing PECL Extensions

Now that you've installed the compiler, you can install PECL extensions using the peclX.Y-sp command for the version of PHP that you want to install the extension for. Any of these commands must be run as the root user.

sudo pecl5.4-sp install <extension name>

sudo pecl5.5-sp install <extension name>

sudo pecl5.6-sp install <extension name>

sudo pecl7.0-sp install <extension name>

sudo pecl7.1-sp install <extension name>

sudo pecl7.2-sp install <extension name>

However, each extension may require different development libraries before it can be compiled and installed.

See our documentation for tutorials on installing specific extensions.

If you are installing an extension we do not have a tutorial for, please send us the steps you used to install the extension so we can add documentation for it.

If you are having trouble installing a particular extension, please contact support.

Last updated: August 31, 2017