how to install memcached on linux
Sunday, July 17, 2011
installing memcache for mysql
there are following step to install memcached for mysql in linux ..
1. download zxvf libevent-1.3e.tar.gz
wget http://www.monkey.org/~provos/libevent-1.3e.tar.gz
2.tar zxvf libevent-1.3e.tar.gz
3.cd libevent-1.3e
4. ./configure
make
make install
5. wget http://danga.com:80/memcached/dist/memcached-1.2.5.tar.gz
6. tar zxvf memcached-1.2.5.tar.gz
7. cd memcached-1.2.5
8. ./configure
make
make install
9. start memcahed server
check memcached
memcached -u nobody -d -m 30 -l 127.0.0.1 -p 11211
(start the server to use 30 megs of ram (-m 30), listen on ip 127.0.0.1 (-l 127.0.0.1) and run on port 11211 (-p 11211) as user ‘nobody’ (-u nobody))
if above command give following error
memcached: error while loading shared libraries: libevent-1.3e.so.1: cannot open shared object file: No such file or directory
then do following
export LD_LIBRARY_PATH=/usr/local/lib
then run the command again
memcached -u nobody -d -m 30 -l 127.0.0.1 -p 11211
*****************************************************************************************************
installing memcache php extension
wget http://pecl.php.net/get/memcache-2.1.2.tgz
tar -xvf memcache-2.1.2.tgz
cd memcache-2.1.2
phpize && ./configure –enable-memcache && make
Now you can copy memcache.so to the module directory
vi /etc/php.ini
Add - extension=memcache.so
/etc/init.d/httpd restart
phpinfo() will now show Memcache
note1 :
if phpize is not installed then install it as follow
yum -y install php-devel
note2 :
if it give error for not finding zlib then do as follows
wget http://www.zlib.net/zlib-1.2.3.tar.gz
tar xvzf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
make
make install
*************************************************************************************************
/etc/httpd === apache conf, logs files
/etc === php.ini
/etc/php.d === php extension setting files
/usr/lib/php/modules/ === php extension folder
0 comments:
Post a Comment