Memcache
To install this extension, SSH in to your server as root and run the following command:
sudo apt-get install gcc make autoconf libc-dev pkg-config sudo apt-get install zlib1g-dev sudo pecl5.X-sp install memcache
Once installed, create a configuration file for the extension and restart PHP.
sudo bash -c "echo extension=memcache.so > /etc/php5.X-sp/conf.d/memcache.ini" sudo service php5.X-fpm-sp restart
Installing Memcache on PHP 7.0
The Memcache extension does not currently work with PHP 7.0. If you attempt to install it on PHP 7.0, you will encounter errors building the extension. As soon as the extension is updated to work with PHP 7.0, you will be able to install it.
Memcached
Installing Memcached on PHP 5.4, 5.5, and 5.6
To install this extension, SSH in to your server as root and run the following command:
sudo apt-get install gcc make autoconf libc-dev pkg-config sudo apt-get install zlib1g-dev sudo apt-get install libmemcached-dev sudo pecl5.X-sp install memcached
When you are shown the prompt
libmemcached directory [no] :
type or paste the following text exactly as shown and press Enter.
no --disable-memcached-sasl
That is, the entire line you'll see on your screen will be as follows once you press Enter.
libmemcached directory [no] : no --disable-memcached-sasl
Once installed, create a configuration file for the extension and restart PHP by running the following command as root
sudo bash -c "echo extension=memcached.so > /etc/php5.X-sp/conf.d/memcached.ini" sudo service php5.X-fpm-sp restart
Installing Memcached on PHP 7.0
To install this extension for PHP 7.0, SSH in to your server as root and run the following commands:
sudo apt-get install gcc make autoconf libc-dev pkg-config sudo apt-get install zlib1g-dev sudo apt-get install libmemcached-dev git clone https://github.com/php-memcached-dev/php-memcached cd php-memcached git checkout php7 /opt/sp/php7.0/bin/phpize PATH=/opt/sp/php7.0/bin:$PATH ./configure --disable-memcached-sasl make sudo make install sudo bash -c "echo extension=memcached.so > /etc/php7.0-sp/conf.d/memcached.ini" sudo service php7.0-fpm-sp restart
Installing Memcached on PHP 7.1
To install this extension for PHP 7.1, SSH in to your server as root and run the following commands:
sudo apt-get install gcc make autoconf libc-dev pkg-config sudo apt-get install zlib1g-dev sudo apt-get install libmemcached-dev git clone https://github.com/php-memcached-dev/php-memcached cd php-memcached git checkout php7 /opt/sp/php7.1/bin/phpize PATH=/opt/sp/php7.1/bin:$PATH ./configure --disable-memcached-sasl make sudo make install sudo bash -c "echo extension=memcached.so > /etc/php7.1-sp/conf.d/memcached.ini" sudo service php7.1-fpm-sp restart
Verifying the Installation
You can verify the memcached extension is installed correctly by running this command:
phpX.Y-sp -i | grep -i "memcached support"
You should see output like the following:
memcached support => enabled
Alert: For Control Panel Help & Tutorials, click here: Panel Tutorials