Home
Unix-Linux Administration
Database
Programming
Advanced Search
Resources
Contact Us
Home arrow Unix-Linux Administration arrow How to Install arrow How to Install PHP Memcache
How to Install PHP Memcache Print
Feb 21, 2009 at 12:40 AM

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.

Step 1: Install libevent

cd /usr/local/src
wget http://monkey.org/~provos/libevent-1.4.9-stable.tar.gz
tar xzvf libevent-1.4.9-stable.tar.gz
cd libevent-1.4.9-stable
./configure && make
make install


Step 2: Install memcached.
cd /usr/local/src
wget http://danga.com/memcached/dist/memcached-1.3.0.tar.gz
tar xvfz memcached-1.3.0.tar.gz
cd memcached-1.3.0

./configure --with-libevent=/usr/local/lib/libevent-1.4.so.2
make
make install

Step 3: Install memcache
cd /usr/local/src/
wget http://pecl.php.net/get/memcache-2.2.4.tgz

tar xzvf memcache-2.2.4.tgz
cd memcache-2.2.4
phpize
./configure
make
makeinstall

Step 4: Test it
Before run you must create symlink
ln -s /usr/local/lib/libevent-1.4.so.2 /usr/lib64/libevent-1.4.so.2
/usr/local/bin/memcached -u nobody -d -m 64 -l 127.0.0.3 -p 11211