1.
准备工作
系统环境:CentOS 5.6 x86_64
memcached 下载地址
http://pecl.php.net/package/memcached
libmemcached下载地址
http://libmemcached.org/
http://download.tangent.org/
2. 安装 libmemcached
tar zxvf libmemcached-1.0.2.tar.gz
cd libmemcached-1.0.2
./configure --prefix=/usr/local/libmemcached --with-memcached
**如果报错:error: tr1/cinttypes: No such file or directory,则执行:
yum install gcc44 gcc44-c++ libstdc++44-devel
export CC=/usr/bin/gcc44
export CXX=/usr/bin/g++44
make
make install
3. 安装memcached扩展
tar zxvf memcached-2.1.0.tgz
cd memcached-2.1.0
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached
4.修改php.ini
vi /usr/local/php/etc/php.ini,加入:extension = "memcached.so"
kill -USR2 `cat /usr/local/php/var/php-fpm.pid`
5.参考
升级libmemcached及php的memcached之pecl扩展
http://www.niutian365.com/blog/article.asp?id=498
系统环境:CentOS 5.6 x86_64
memcached 下载地址
http://pecl.php.net/package/memcached
libmemcached下载地址
http://libmemcached.org/
http://download.tangent.org/
2. 安装 libmemcached
tar zxvf libmemcached-1.0.2.tar.gz
cd libmemcached-1.0.2
./configure --prefix=/usr/local/libmemcached --with-memcached
**如果报错:error: tr1/cinttypes: No such file or directory,则执行:
yum install gcc44 gcc44-c++ libstdc++44-devel
export CC=/usr/bin/gcc44
export CXX=/usr/bin/g++44
make
make install
3. 安装memcached扩展
tar zxvf memcached-2.1.0.tgz
cd memcached-2.1.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
4.修改php.ini
vi /usr/local/php/etc/php.ini,加入:extension = "memcached.so"
kill -USR2 `cat /usr/local/php/var/php-fpm.pid`
验证是否生效:
/usr/local/php/bin/php -m | grep memcached
5.参考
升级libmemcached及php的memcached之pecl扩展
http://www.niutian365.com/blog/article.asp?id=498