1. 通過yum安裝
代碼如下:
yum -y install memcached
2. 加入啟動服務
代碼如下:
chkconfig --level 2345 memcached on
3. 配置Memcached
代碼如下:
vim /etc/sysconfig/memcached4. 安裝libmemached
代碼如下:
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz tar -zxvf libmemcached-1.0.16.tar.gz cd libmemcached-1.0.16 ./configure -prefix=/usr/local/libmemcached -with-memcached make && make install
5. 安裝php-devel
代碼如下:
yum install php-devel
6. 安裝PHP Memcached擴展
代碼如下:
wget http://pecl.php.net/get/memcached-2.1.0.tgz tar -zxvf memcached-2.1.0.tgz cd memcached-2.1.0 /usr/local/php/bin/phpize ./configure -enable-memcached -with-php-config=/usr/local/php/bin/php-config -with-zlib-dir -with-libmemcached-dir=/usr/local/libmemcached -prefix=/usr/local/phpmemcached make && make install*