综合了几个文章,终于搞定,这里记录下步骤:
yum -y install memcached
安装完往后实行如下操作:
chkconfig memcached on/etc/init.d/memcached start
实行
netstat -tunlp | grep memcached
看到11211端口,解释memcached安装成功。
安装libmemached
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz tar -zxvf libmemcached-1.0.16.tar.gz cd libmemcached-1.0.16 ./configure -prefix=/usr/local/libmemcached -with-memcached make && make install
下载memcache扩展包并安装
git clone git://github.com/php-memcached-dev/php-memcached.gitcd php-memcached/
安装扩展
/usr/local/php/bin/phpize./configure -enable-memcached -with-php-config=/usr/local/php/bin/php-config -with-zlib-dir -with-libmemcached-dir=/usr/local/libmemcached -prefix=/usr/local/phpmemcached --disable-memcached-saslmake -j4make install
安装完毕后会提示扩展目录:/usr/local/php/lib/php/extensions/no-debug-zts-20151012/
编辑php.ini
extension=/usr/local/php/lib/php/extensions/no-debug-zts-20151012/memcached.so
将其放入末了一行,重启php做事器(通过组件调用的,重启下web做事)
重新查看phpinfo