User Tools

Site Tools


Sidebar


guides:install:memcache

Memcache

1) Install php extension memcache:

a) by pear

pear install http://pecl.php.net/get/memcache-2.2.5.tgz

Add “extension=memcache.so” to php configs by

echo "extension=memcache.so" > /etc/php.d/memcache.ini

Update to latest

pecl upgrade memcache

b) by yum

 yum install php-memcache

2) Install memcached from source on Linux:

Get latest libevent from http://monkey.org/~provos/libevent/

cd /usr/local/src
wget http://monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
tar xzf libevent-1.4.14b-stable.tar.gz
cd libevent-1.4.14b-stable
./configure
make
make install

Update libevent.conf

echo '/usr/local/lib/' >> /etc/ld.so.conf.d/libevent.conf

Run update

ldconfig -v

Obtain the latest from http://memcached.org/

cd /usr/local/src
wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
tar zxvf memcached-1.4.5.tar.gz
cd memcached-1.4.5
./configure
make
make install
mkdir /var/run/memcached
cp ./scripts/memcached.sysv /etc/init.d/memcached-init

Edit script and add directory path to memcached binary

vi /etc/init.d/memcached-init
daemon memcached -d -p
daemon /usr/local/bin/memcached -d -p

The basic memcached options are:

memcached -d [-m memory_in_megabytes [-l listen_ip_address [-p listen_port]]]

Example:

memcached -d -m 256 -u nobody -p 11211 -l 192.168.0.1

3) Install memcached on Windows

Download windows binaries from

http://code.jellycan.com/memcached/

guides/install/memcache.txt · Last modified: 2011/04/29 17:43 by michaelc