[CentOS] Memcache



Memcache is a free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.

Installation from Linux Packages

Ubuntu & Debian


apt-get install memcached libmemcached php5-memcached



yum install memcached

Installation from EasyApache (WHM/cPanel)

EasyApache MemCache is the Apache module rather than the PHP module as we do not list or provide the PHP module there. When you compile EasyApache with the MemCache Apache module, you end up with it available via Apache only not via PHP. 

1. Please refer to the wiki article on EasyApache Build

Select the php addon "mod_mem" when building in EasyApache

After installing these components, then create the following file:


echo "/usr/local/lib/" > /etc/ld.so.conf.d/libevent-x86_64.conf

Run the following:



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

Test to make sure it is installed:


root@host [~]# php -i | grep -i memcached


memcached support => enabled

libmemcached version => 1.0.4

Registered save handlers => files user sqlite memcached

Was this article helpful?
0 out of 0 found this helpful

Have more questions? Contact our support instantly via Live Chat