- Help Center
- Questions and Answers
- ISPmanager
Installing PHP Extension Manually - ISPmanager
To install the native PHP version, use the command:
CentOS |
yum install <package_name> |
Debian |
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):
- Install packages (may require other packages depending on the extension):
- CentOS
yum install autoconf gcc zlib-devel
- Debian
apt install autoconf gcc zlib1g-dev
- CentOS
- Install the extension:
/opt/<PHP_version_directory>/bin/pecl install memcache
- Connect the extension:
echo extension=<extension_library_name> >>
/opt/<PHP_version_directory>/etc/php.d/<extension_name>.ini
To install an alternative PHP version using source code (for example, for the env extension):
- Download and unzip the file with the source code of the required extension:
cd /tmp
wget -O env.tar.gz http://pecl.php.net/get/env
tar xzvf env.tar.gz
cd env-0.2.1/ - Run configuration and build:
/opt/<PHP_version_directory>/bin/phpize
./configure --with-php-config=/opt/<PHP_version_directory>/bin/php-config &&
make && make install - Include the extension for the required PHP version:
echo 'extension=env.so' > /opt/<PHP_version_directory>/etc/php.d/20-env.ini