Installing PHP Extension Manually - ISPmanager

To install the native PHP version, use the command:


yum install <package_name>


apt install <package_name>

You can use the Pecl package manager or source code to install an alternative PHP version.

To install an alternative PHP version using the Pecl package manager (for example, for a memcache application):

  1. Install packages (may require other packages depending on the extension):
    1. CentOS
      yum install autoconf gcc zlib-devel
    2. Debian
      apt install autoconf gcc zlib1g-dev
  2. Install the extension:
    /opt/<PHP_version_directory>/bin/pecl install memcache
  3. Connect the extension:
    echo extension=<extension_library_name> >> 

To install an alternative PHP version using source code (for example, for the env extension):

  1. Download and unzip the file with the source code of the required extension:
    cd /tmp

    wget -O env.tar.gz

    tar xzvf env.tar.gz

    cd env-0.2.1/
  2. Run configuration and build:

    ./configure --with-php-config=/opt/<PHP_version_directory>/bin/php-config &&
    make && make install
  3. Include the extension for the required PHP version:
    echo '' > /opt/<PHP_version_directory>/etc/php.d/20-env.ini