How to Install Memcached on cPanel/WHM server

In cPanel 11.88 Memcached is now available in the EasyApache4 yum repo.

This tutorial installs Memcache as a service on port 11211. This works for a single site, but Memcached has no auth service on this set up so it is not appropriate for multiple separate users. Instead use a Memcached socket, which is not covered here.

To install, run the following command:

yum -y install ea-php*-php-memcached

Enable the service:

systemctl enable memcached.service

Edit the config file:

/etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS=""

Change options to listen locally

OPTIONS="-l 127.0.0.1"

Start Memcached:

systemctl start memcached.service

You can now verify with lsof:

lsof -i :11211
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
memcached 17880 memcached 26u IPv4 2040097288 0t0 TCP localhost:memcache (LISTEN)
memcached 17880 memcached 27u IPv4 2040097289 0t0 UDP localhost:memcache

Memcached is now installed and started.

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

How to fix defaultwebpage.cgi on a webserver

Running the following commands solves the above problem:   /scripts/updateuserdomains...

How to fix IP Missing issue on cPanel/WHM

We are here to help you with solving the problem of Missing IP Server in list accounts. The...

Install Let's Encrypt SSL in cPanel/WHM

Let's Encrypt, a valid, open-source license that offers free SSL for your domains. The Let's...

Fix Email Issue on a server using the MSFE

To solve the problem of not sending/receiving email on a server using the MSFE / Mailscanner...

Domain names are not showing in WHM

We were unable to see any domains listed under WHM -> List Accounts. However, we can see the...