手记

memcached在php中的应用

memcache在php中编译
#  wget http://www.lishiming.net/data/attachment/forum/memcache-2.2.3.tgz
# tar zxvf memcache-2.2.3.tgz
# cd memcache-2.2.3
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make
# make install
# cp modules/memcache.so /usr/local/php/ext/
然后在php.ini 中添加
extension = memcache.so
修改扩展路径为:extension_dir = "/usr/local/php/ext"
保存后可以利用 /usr/local/php/bin/php-cgi -m  检测和查看具体的参数


memcached 的编译安装
wget http://memcached.googlecode.com/files/memcached-1.2.8.tar.gz

tar zxvf memcached-1.2.8.tar.gz
cd  memcached-1.2.8
./configure --prefix=/usr/local/memcached
make && make install

启动:

/usr/local/memcached/bin/memcached -m 2048 -p 11211 -l 127.0.0.1 -d -u www
-m  后边指定memecached使用多少内存,单位是M
-p  指定memcached 启动端口
-l  指定绑定的IP
-u  指定以某个账户的身份启动

0人推荐
随时随地看视频
慕课网APP