php7安装Memcached扩展
安装 memcached,需安装依赖库 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
make && make install
安装memcached扩展
git clone https://github.com/php-memcached-dev/php-memcached.git
cd php-memcached/
git checkout php7
phpize
./configure --disable-memcached-sasl --with-libmemcached-dir=/usr/local/libmemcached
make && make install
安装memcached服务
wget http://memcached.org/latest
tar -zxvf memcached-1.x.x.tar.gz
cd memcached-1.x.x
./configure && make && make test && sudo make install
Windows下安装memcached
libmemcached官网只提供了linux版,所以memcached无法直接在windows下使用。
对于网上有部分教程指出可以通过源码编译libmemcached的windows版,本人未作尝试。因正式环境是在linux中,windows只是用于编辑器语法高亮,所以没有费时间去尝试。有兴趣的小伙伴可以自行尝试