Install memcached extension in centos php and support sasl and memcachedsasl
1. Install sasl
yum install cyrus-sasl-lib.x86_64yum install cyrus-sasl-devel.x86_64
2. Download libmemcached
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
3. Compile and install
tar zxvf libmemcached-1.0.16.tar.gzcd libmemcached-1.0.16./configure --prefix=/usr/local/libmemcached --enable-saslmakemake install
4. Install memcached
wget http://pecl.php.net/get/memcached-2.1.0.tgztar zxvf memcached-2.1.0.tgzcd memcached-2.1.0
Obtain the <pre name = "code" class = "python"> php-config directory whereis <span style = "font-family: Arial, Helvetica, sans-serif; "> php-config </span>
Phpize./configure -- with-php-config = php-config directory -- with-libmemcached-dir =/usr/local/libmemcached/-- enable-memcached-sasl
make
make install
5. Modify the corresponding configuration
Add
Vi/etc/php. d/memcache. ini (previously installed memcache) or directly put it in the php. ini file
extension=memcached.somemcached.use_sasl = 1
Restart the web server nginx or apache