How to Install memcached on CentOS Plesk Server

Install memcached daemon with command

Enable memcached to start on boot

Start memcached

You can verify if memcached is running with the command “netstat -lntp”

By default Memcached listen on all interfaces (0.0.0.0:11211). You need to make it bind to 127.0.0.1 only, so no one will be able to access your Memcached installation from the public. For securing Memcached installation, refer How to secure Memcached on CentOS 7. After Memcached is secured, you will see it listen on 127.0.0.1 only like the following

Install memcached PHP Module

Install the requirements

Replace default system PHP with PHP version on which you need memcache PHP module installed. In this case, I will be installing the PHP module for PHP version 7.4

Now run the command

If you get error related to phpize missing, you need to install PHP devel package.

After install finished, you need to edit php.ini

At end of the file, add

Restart php-fpm

Install memcache module

the latest version of memcache won’t work with PHP 7.4, so we need to use an older version.

To install version 4.0.5.2 of memcache, run

After installing, edit php.ini file

At end of the file, add

Restart php-fpm

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *