Install memcache on cpanel

How to install memcached on cpanel server.

1: Login to WHM > Software > Easyapache 4 > “Currently Installed Packages” > Customize > Apache module > search using memcache > install this if it is not.

2: Login to server via ssh as root user and execute following command.

yum install memcached.x86_64 -y

3: Then WHM > Software > Module Installers > PHP Pecl, search for memcache this will list both memcache and memcached, install both.

4: Restart service apache.

5: Now start memcached by executing command

memcached -d -m 512 -l 127.0.0.1 -p 11211 -u nobody

6: Verify if it is working by executing command :  systemctl start memcached

7: Enable memcached so whenever server will reboot service will get start automatically.

systemctl enable memcached

8: Check memcached status using command.

systemctl status memcached

Output should be like:

* memcached.service – Memcached
Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2018-11-05 18:38:46 -05; 7s ago
Main PID: 47657 (memcached)
CGroup: /system.slice/memcached.service
`-47657 /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024

Nov 05 18:38:46 server.listitjamaica.com systemd[1]: Started Memcached.
Nov 05 18:38:46 server.listitjamaica.com systemd[1]: Starting Memcached…

Now you shall able to use memcached  in your applications.