安装Memcached
安装memcached
之前需要安装libevent
依赖
shell> cd /root/amp
shell> wget https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz
shell>tar -zxvf libevent-2.1.11-stable.tar.gz
shell>cd libevent-2.1.11-stable
shell>./configure --prefix=/usr/local/libevent && make && make install
查看是否安装成功需要看编译过程有没有error,还有就是查看/root/amp/
下有没有libevent 文件夹
安装Memcached
shell> cd /root/amp
shell> wget http://www.memcached.org/files/memcached-1.5.16.tar.gz
shell> tar -zxvf memcached-1.5.16.tar.gz
shell> cd memcached-1.5.16
shell> ./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent && make && make install
安装PHP—memcached扩展
Linux下
cd /root/amp/
wget http://pecl.php.net/get/memcached-3.1.3.tgz
tar -zxvf memcached-3.1.3.tgz
cd memcached-3.1.3
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config
#报错
#checking for zlib location... configure: error: memcached support requires ZLIB. Use --with-zlib-dir=<DIR> to specify the prefix where ZLIB headers and library are located
#需要安装zlib-devel
yum install zlib-devel
#configure: error: memcached support requires libmemcached. Use --with-libmemcached-dir=<DIR> to specify the prefix where libmemcached headers and library are located
#这是因为需要安装libmemcached-devel
yum install libmemcached-devel
./configure --with-php-config=/usr/bin/php-config
make && make install
启用扩展模块请看https://blog.youkuaiyun.com/github_39437588/article/details/90023951