cd /usr/local/src/
git clone https://github.com/websupport-sk/pecl-memcache

编译安装memcache扩展

cd pecl-memcache/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install

Installing shared extensions: /usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/

上面已经安装完成memcache扩展,接下来把它加入php.ini中

vim /etc/php.ini

extension_dir = "/usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/"
extension = "memcache.so"

重启php-fpm使配置生效