为php安装memcached扩展笔记

1、下载libmemcached库 地址在https://code.launchpad.net/libmemcached

wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz

2、下载php memcached扩展,地址在http://pecl.php.net/package/memcached

wget http://pecl.php.net/get/memcached-2.2.0.tgz

3、解压

[root@localhost solf]# tar xzf libmemcached-1.0.18.tar.gz 
[root@localhost solf]# tar xzf memcached-2.2.0.tgz

4、安装libmemcached

[root@localhost libmemcached-1.0.18]# ./configure --prefix=/usr/local/libmemcached --with-memcached

[root@localhost libmemcached-1.0.18]# make && make install

5、安装PHPmemcached扩展

运行phpize命令生成configure配置文件

[root@localhost memcached-2.2.0]# /usr/local/php/bin/phpize 
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

安装,因为机子上可能没有sasl,这里暂时不启用,加上参数--disable-memcached-sasl,否则--enable-sasl

[root@localhost memcached-2.2.0]# ./configure --with-php-config=/usr/local/php/bin/php-config --disable-memcached-sasl

make && make install

到些安装完成

6、配置php,加载memcahed扩展

extension=memcached.so

7、重启httpd

[root@localhost no-debug-non-zts-20090626]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

8、查看phpinfo

memcached

memcached supportenabled
Version2.2.0
libmemcached version1.0.18
SASL supportno
Session supportyes
igbinary supportno
json supportno
msgpack supportno


DirectiveLocal ValueMaster Value
memcached.compression_factor1.31.3
memcached.compression_threshold20002000
memcached.compression_typefastlzfastlz
memcached.serializerphpphp
memcached.sess_binary00
memcached.sess_connect_timeout10001000
memcached.sess_consistent_hash00
memcached.sess_lock_expire00
memcached.sess_lock_max_wait00
memcached.sess_lock_wait150000150000
memcached.sess_locking11
memcached.sess_number_of_replicas00
memcached.sess_prefixmemc.sess.key.memc.sess.key.
memcached.sess_randomize_replica_read00
memcached.sess_remove_failed00
memcached.store_retry_count22


转载于:https://my.oschina.net/ptk/blog/268442

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值