准备安装包 代码: #memcached wget http://memcached.org/files/memcached-1.4.33.tar.gz #memcache for php7 wget https://github.com/websupport-sk/pecl-memcache/archive/php7.zip 编译安装memcached 代码: #因为是yum安装的libevent,不必再--with-libevent指定libevent ./configure --prefix=/usr/local/memcached make && make install #启动systemctl restart memcached.service php支持memcache的拓展(解压进入目录) 代码: /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make && make install php.ini中添加 [memcache] extension=memcache.so