To install memcache you should have "libevent".
Follow following steps to install libevent:
Step 1: Download libevent using following command
wget https://github.com/downloads/libevent/libevent/libevent-2.0.16-stable.tar.gz
Step 2: tar -zxvf libevent-2.0.16-stable.tar.gz
Step 3: cd libevent-2.0.16-stable
Step 4: ./configure
Step 5: make
Step 6: make install
Step 7: Create a symbolic link
ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
That's it now you are ready to install memcache
Now, Follow following steps to install memcache
Step 1: Download memcache using following command
wget http://memcached.org/latest
Step 2: tar -zxvf memcached-1.4.13.tar.gz
Step 3: cd memcached-1.4.13
Step 4: ./configure
Step 5: make
Step 6: make install
Step 7: run following command to start memcache server
memcached -d -u memcache_user -p 11211 -m 1024 -l 127.0.0.1
where: -
-d daemon
-u username
-p port
-m memory
-l ip to listen
now your memcache server should run, don't get excited there is some more work to do. Now you have to install PHP memcache extension so that you can start writing memcache code in your PHP files.
Follow following steps to install memcache PHP extension
Step 1: Download memcache PHP extension
wget http://pecl.php.net/get/memcache-2.2.4.tgz
Step 2: tar -zxvf memcached-2.2.4.tgz
Step 3: cd memcached-2.2.4
Step 4: phpize && ./configure --enable-memcache
Step 5: make
Step 6: copy modules/memcache.so to your PHP extension directory (see php.ini file and search for extension_dir to know your PHP extension directory path)
Step 7: open your php.ini file and add following line
extension=memcache.so