How to install Memcached

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.

Memcached is simple yet powerful. Its simple design promotes quick deployment, ease of development, and solves many problems facing large data caches. Its API is available for most popular languages.

memcached : High Performance, Distributed Memory Object Cache server package.
perl-Cache-Memcached : Perl client (library) to work with memcached server.
python-memcached : Perl client (library) to work with memcached server.
php-pecl-memcache : PHP extension to work with the Memcached server.

Steps to install LibEvent

First we need to check if libevent is installed or not?
whereis libevent

Try to install it through yum
yum install libevent

If you don’t find it, then we need to download and install it.  Type following sequence of commands on your shell

wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar xfz libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure
make
make install

Steps to install Memcached

Try to with Yum

yum install memcached

or

Download and install from source.

wget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz
tar xfz memcached-1.4.15.tar.gz
cd memcached-1.4.15
./configure
make
make install

Run Memcached as a daemon (d = daemon, m = memory, u = user, l = IP to listen to, p = port)

memcached -d -m 1024 -u root -l 127.0.0.1 -p 11211

Install PHP Memcache

Try to install it through easyapache. Otherwise, use the following steps.

wget  http://pecl.php.net/get/memcache-3.0.8.tgz
tar zxvf memcache-3.0.8.tgz
cd memcache-3.0.8
phpize
./configure
make
make install

vi /usr/local/lib/php.ini

Find the extension as below and if it is not existed, add it in the php.ini.

extension=memcache.so

Restart the Apache services.

service httpd restart

Tomonitor the memcached status

watch “echo stats | nc 127.0.0.1 11211”

$ echo “stats” | nc 127.0.0.1 11211

watch ‘php -r ‘”‘”‘$m=new Memcache;$m->connect(“127.0.0.1″, 11211);print_r($m->getstats());'”‘”

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

cPanel & WHM Version 74 Now in STABLE

cPanel has released cPanel & WHM Version 74 to the STABLE tier. It includes updates for some...

Installing cpanel on google cloud

Create a new CentOS 7 instance on your google cloud engine. From the cPanel & WHM System...

Install Free SSL Let’s Encrypt plugin in cPanel

Let’s Encrypt is a trusted, open source certificate authority that offers free SSL certificates...

Replace MySQL with Percona in cPanel Server

Percona Server is an enhanced drop-in replacement for MySQL. If you are a web hosting service...

Install nginx as a reverse proxy cPanel plugin

Install Nginx on your cPanel/WHM server using the Engintron cPanel Plugin as a reverse proxy. It...

Powered by WHMCompleteSolution