CentOS Linux 安装PHP的memcached扩展

一、下载、编译以及安装libmemcached

cd /data0/software/
wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
tar zxvf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18
./configure --prefix=/usr/local/libmemcached  --with-memcached
make && make install 
cd ..

二、下载、编译以及安装memcached的PHP扩展

cd /data0/software/
wget http://pecl.php.net/get/memcached-2.2.0.tgz
tar zxvf memcached-2.2.0.tgz
cd memcached-2.2.0
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached
make
make install
cd ../

三、配置php.ini

vi /usr/local/webserver/php/etc/php.ini

在extension_dir相关位置加上下面的配置

extension = "memcached.so"

保存退出之后,重启php fast-cgi即可。

除非注明,本博客文章均为原创,转载请以链接形式标明本文地址
本文地址: http://blog.cnwyhx.com/centos-linux-php-install-memcached-extension

Leave a Reply