memcache的配置

memcache的安装

安装包下载:

wget http://memcached.googlecode.com/files/memcached-1.4.4.tar.gz

wgethttp://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz

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

libevent安装

tar zxvf libevent-1.4.13-stable.tar.gz

cdlibevent-1.4.13-stable

/configure--prefix=/usr/local/libevent

make && make install

memcached安装

tar zxvf memcached-1.4.4.tar.gz

cdmemcached-1.4.4

./configure--prefix=/usr/local/memcached--with-libevent=/usr/local/libevent

make && make install
 

开机启动

vim /etc/rc.lcoal/usr/local/memcached/bin/memcached -d -m 4000 -u root -p 11211

memcache-php安装

需要用到php开发包

yuminstallphp-devel

apt-get install php-devel
 tar vxzf memcache-2.2.5.tgz

cdmemcache-2.2.5

/usr/bin/phpize

./configure-enable-memcache-with-php-config=/usr/bin/php-config-with-zlib-dir

make&&makeinstall

 

找到memcache.ini配置

添加下面配置
extension=memcache.so

[memcache]

memcache.dbpath="/var/lib/memcache"

memcache.maxreclevel=0

memcache.maxfiles=0

memcache.archivememlim=0

memcache.maxfilesize=0

memcache.maxratio=0
 

相关推荐