Download and Extract Memcache package
root@server [~]# cd /usr/local/srcroot@server [/usr/local/src]# wget http://pecl.php.net/get/memcache-3.0.6.tgz
root@server [/usr/local/src]# tar -xzf memcache-3.0.6.tgz
Compilation and installation
root@server [/usr/local/src]# cd memcache-3.0.6root@server [/usr/local/src/memcache-3.0.6]# phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
root@server [/usr/local/src/memcache-3.0.6]# ./configure
root@server [/usr/local/src/memcache-3.0.6]# make
root@server [/usr/local/src/memcache-3.0.6]# make install
Enable memcache in php.ini
root@server [~]# echo "extension=memcache.so" >> /usr/local/lib/php.ini
root@server [~]# /etc/init.d/httpd restart
If 'memcache' is successfully loaded, you will get a result as like follows.
root@server [~]# php -i | grep memcache
memcache
memcache support => enabled
memcache.allow_failover => 1 => 1
memcache.chunk_size => 32768 => 32768
memcache.compress_threshold => 20000 => 20000
memcache.default_port => 11211 => 11211
memcache.hash_function => crc32 => crc32
memcache.hash_strategy => consistent => consistent
memcache.lock_timeout => 15 => 15
memcache.max_failover_attempts => 20 => 20
memcache.protocol => ascii => ascii
memcache.redundancy => 1 => 1
memcache.session_redundancy => 2 => 2
That's it..