Memcached issue : memcache loaded could not connect on Cpanel server

Recently we have compile Apache with memcache php module and the module was also enabled in the php.ini file but sometimes it shows the error below :

[wpfmb type=’error’ theme=2]memcache loaded could not connect[/wpfmb]

To resolve the error you need to start the memcache and open the port number 11211 which is the default port number of memcache.

We can enable it by using the below command :

#memcached -d -u nobody -m 1024 -p 11211

Once memcahed started , We can check the port number is opened or not by using the below command:

#netstat -nap | grep 11211

Output will be as follows:

root@vps [~]# netstat -nap | grep 11211
tcp 0 0 TIME_WAIT -
tcp 0 0 TIME_WAIT -
tcp 0 0 :::11211 :::* LISTEN 23327/memcached
udp 0 0* 23327/memcached

It will resolve theĀ error.