Install Memcached with Admin Panel on Centos 6.4 64bit

Since I installed PHP 5.5.3 and Zend OPcache v7.0.3, it is good for WordPress opcode already. For other cache optimization, I need a cache system. I choose Memcached server.

Part 1. Install Memcached Server

I install Memcached with following command:

yum install memcached

Then change the setting of it.

 vi /etc/sysconfig/memcached

Change the last line of option as below to restrict access from only. and CACHSIZE to 128M.

PORT=&quot;11211&quot;;<br />
USER=&quot;memcached&quot;;<br />
MAXCONN=&quot;1024&quot;;<br />
CACHESIZE=&quot;128&quot;;<br />
OPTIONS=&quot;-l;;<br />

Start Memcached

/etc/init.d/memcached start

Memcached doesn’t start by default upon boot, we want it to start upon boot.

chkconfig --levels 235 memcached on

Part 2. Install PHP Memcached Extension

yum install php55w-pecl-memcache

I use the default setting of this extension, except the session. Run following command:

vi /etc/php.d/memcache.ini

Uncomment  the session.save_handler and session.save_path

session.save_handler = memcached</p>
<p>session.save_path = &quot;;

Look at the Memcache PHP Extension information from phpinfo()


Part 3. Install Admin Panel

I am also install a web admin panel for Memcached server. There are a lot, but I choose phpmemcacheadmin.

<br />
cd /var/www/<br />
mkdir mem &amp;&amp; cd mem<br />
wget<br />
tar -xvzf phpMemcachedAdmin-1.2.2-r262.tar.gz<br />
chmod +r *<br />
chmod 0777 Config/Memcache.php

It works perfect on my server. See screen shot below.

I can see live stats and change the configuration of Memcache