Plesk Onyx 17 – enable modules memcache and memcached

Goal: install php modules for memcache and memcached on Plesk Onyx 17 to improve performance of PHP scripts on your server.


This guide is based on an ubuntu server with Plesk Onyx 17 and might also work for a debian based Linux system.

Login to the system using ssh as user root.

The following steps are for php5.6 – for other versions, just replace the 5.6 with e.g. 7.0 or 7.1 to install the modules to the appropriate PHP version.

memcache vs memcached

Basically, memcached is more up to date and is supposed to perform better for bigger websites and seems to be more frequently updated. More information are linked in the related pages at the end of this post.

Install requirement libraries

apt-get install plesk-php56-dev libmemcached-dev gcc libghc-zlib-dev memcached

Create php modules with build-in pecl

Install pecl module for memcache

/opt/plesk/php/5.6/bin/pecl install memcache

Install pecl module for memcached

/opt/plesk/php/5.6/bin/pecl install memcached

When asked about the libmemcached directory, enter no –disable-memcached-sasl:

libmemcached directory [no] : no –disable-memcached-sasl

Activate the modules in Plesk / php configuration

Activate memcache module

echo "" > /opt/plesk/php/5.6/etc/php.d/memcache.ini

Activate memcached module

echo "" > /opt/plesk/php/5.6/etc/php.d/memcached.ini

Reread php config and restart php fpm process

Let Plesk re-read the change php configuration

plesk bin php_handler --reread

And finally restart the php-fpm process to read the new configuration

service plesk-php56-fpm restart

Validate successful installation

You can create a simple php script with this content and call it with the browser:

<?php phpinfo(); ?>

Open the Plesk admin interface at port 8443 on your web server, login as admin user and go to “Tools & Settings” / “PHP Settings” and select the appropriate PHP version + FPM / CGI for the correct module. There should be two new entries: memcache + memcached as on this screenshot:

Plesk - install PHP modules for memcache and memcached

Plesk – install PHP modules for memcache and memcached

Related links