How to Install Memcache into cPanel Server.

Memcache module provides handy procedural and object oriented interface to memcached, highly effective caching daemon, which was especially designed to decrease database load in dynamic web applications.

Make the Sources Folder
mkdir ~/memcache

Compile and Install LibEvent

cd ~/memcache
wget http://www.monkey.org/~provos/libevent-1.4.9-stable.tar.gz
tar xvfz libevent-1.4.9-stable.tar.gz
cd libevent-1.4.9-stable
./configure
make
make install

Compile and Install Memcache

cd ~/memcache
wget http://www.danga.com/memcached/dist/memcached-1.2.6.tar.gz
tar xvfz memcached-1.2.6.tar.gz
cd memcached-1.2.6
./configure –with-lib-event=/usr/local/
make
make install

Starting Memcache
memcached

If you get the following error then you may beed to register libevent:
error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

Register LibEvent

vi /etc/ld.so.conf.d/libevent-i386.conf
Open above file and put the line /usr/local/lib/ and save the file and fire below command.
ldconfig

Installing PHP Memcache

cd ~/memcache
wget http://pecl.php.net/get/memcache-3.0.3.tgz
tar xvfz memcache-3.0.3.tgz
cd memcache-3.0.3
phpize
./configure
make
make install

Add extension on php.ini

vi /usr/local/lib/php.ini
extension=memcache.so

Then restart the Apache service.
service httpd restart

=============================================>
Reference : http://php.net/manual/en/book.memcache.php
Reference : http://www.memcached.org/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s