Linux安装memcached和memcache扩展

  • 编辑时间: 2017-11-30 10:22:58
  • 浏览量:154
  • 来源:

//安装memcached服务器端

tar -zxvf libevent-2.1.3-alpha.tar.gz 

cd libevent-2.1.3-alpha 

./configure -prefix=/usr/local/memcache/libevent 

make && make install

//启动memcached

 /usr/local/memcache/bin/memcached -d -l 192.168.189.129 -p 11211 -m 2048 -u root

//链接memcache

telnet192.168.189.129 11211


//安装memcache扩展

tar -zxvf memcache-3.0.8.tgz

cd ./memcache-3.0.8

/usr/bin/phpize

./configure --with-php-config=/usr/bin/php-config(如果报错缺少zlib  yum install -y zlib.x86_64 zlib-devel.x86_64)

make && make install


vim /etc/php.ini(实际位置请自行修改!)

增加一行extension = "memcache.so"

重启服务器