memcached扩展包安装 memcached扩展包依赖libmemcached,所以先安装libmemcached wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz tar zxf libmemcached-1.0.18.tar.gz cd libmemcached-1.0.18/ ./configure --prefix=/usr/local/libmemcached --with-memcached make && make install 再安装memcached扩展包,由于pecl上的扩展包暂未支持到php7,所以只能去github上面拉包 git clone https://github.com/php-memcached-dev/php-memcached cd php-memcached-master/ /usr/local/php/bin/phpize //没有这个命令的可以用yum安装一个 如果报错Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. yum -y install autoconf ./configure --enable-memcached --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --disable-memcached-sasl make && make install 然后再php.ini文件中添加 extension=“memcached.so” ,追加文件末尾就可以 重启php-fpm /etc/rc.d/init.d/php-fpm restart