Question
How to install/uninstall Memcached extension for Plesk PHP handlers?
Answer
Warning: This is a process that it is done at your own will and risk which is not supported by Plesk.
Note: Memcached extension is only available/supported up to PHP 7.1
Since Memcached extension is not included in Plesk PHP packages, it can be installed manually:
- Log into the server via SSH and prepare the environment:
For rpm-based OS (CentOS, RHEL, CloudLinux)
# wget -q -O – http://www.atomicorp.com/installers/atomic | sh
# yum install make memcached gcc libmemcached-devel zlib-devel plesk-php*-develNote: Atomic repositories are being used instead of the CentOS ones because of newer package versions
For deb-based OS (Debian, Ubuntu)
# apt install memcached
# apt install autoconf automake gcc libmemcached-dev libhashkit-dev pkg-config plesk-php..-dev zlib1g-dev - Perform the memcached installation for PHP 7.x:
Note: in the example below, instructions for PHP 7.1 are provided. Replace ‘7.1’ with the required PHP version
# /opt/plesk/php/7.1/bin/pecl install memcached
Warning: Only for CentOS 6: Before proceeding with this step check the following
Check the binaries that are going to be used for CentOS 6
Be sure that the binaries used by the process are from the newer version available on the server by linking them as follow (The example below is for version 2.68):
# mv /usr/bin/autoconf{,.bkp}
# ln -s /usr/bin/autoconf268 /usr/bin/autoconf
# mv /usr/bin/autom4te{,.bkp}
# ln -s /usr/bin/autom4te268 /usr/bin/autom4te
-
Register extension in configuration file:
# echo “extension=memcached.so” > /opt/plesk/php/7.1/etc/php.d/memcached.ini
-
Update PHP handlers information:
# plesk bin php_handler –reread
-
Restart Apache and PHP-FPM services at Plesk > Tools & Settings > Services Management
To uninstall memcached extension, perform the following steps:
Note: in the example below, instructions for PHP 7.1 are provided. Replace ‘7.1’ with the required PHP version.
- Remove memcached configuration file:
# rm /opt/plesk/php/7.1/etc/php.d/memcached.ini
- Uninstall the extension:
# /opt/plesk/php/7.1/bin/pecl uninstall memcached
- Update PHP handlers information:
# plesk bin php_handler –reread
- Restart Apache and PHP-FPM services at Plesk > Tools & Settings > Services Management.