Linux安装memcached,并且安装php memcached组件,实例为ubuntu14安装

作者:admin 发布时间:December 1, 2015 分类:技术

所有安装均为下载后编译安装

首先安装的是libevent 这个是memcached所依赖的,没有的话无法安装

wget https://sourceforge.net/projects/levent/files/libevent/libevent-2.0/libevent-2.0.22-stable.tar.gz

tar -zxf libevent-2.0.22-stable.tar.gz

cd libevent-2.0.22-stable

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

make && make install

开始安装memcached

wget http://www.memcached.org/files/memcached-1.4.25.tar.gz

tar -zxf memcached-1.4.25.tar.gz

cd memcached-1.4.25

./configure -prefix=/usr/local/memcached -with-libevent=/usr/local/libevent

make && make install

安装libmemcached,这个是php的memcached依赖的.

wget --no-check-certificate https://launchpadlibrarian.net/165454254/libmemcached-1.0.18.tar.gz  //--no-check-certificate 这个是为了能让wget下载https的东西.

tar -zxf libmemcached-1.0.18.tar.gz

cd libmemcached-1.0.18

./configure -prefix=/usr/local/libmemcached -with-memcached=/usr/local/memcached/bin/memcached

make && make install

开始安装php的memcached

wget http://pecl.php.net/get/memcached-2.2.0.tgz

tar zxf memcached-2.2.0.tgz

cd memcached-2.2.0

/usr/local/php/bin/phpize  //这个根据你的实际情况需要修改地址

./configure --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached

make && make install

安装完不要忘记把相关生成的扩展文件添加到php.ini文件中.