php安装memcache扩展

PHP 5.6.23,查询目前最稳定的版本是memcache-2.2.7。

php安装memcache扩展 

1.下载并解压缩。

 wget http://pecl.php.net/get/memcache-2.2.7.tgz

tar zxvf memcache-2.2.7.tgz

2. 编译。根据实际情况使用phpize和php-config。

[[email protected] memcache-2.2.7]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
[[email protected] memcache-2.2.7]# ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config

3.安装。make;make install

[[email protected] memcache-2.2.7]# make install
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

4.修改php.ini(添加 extension=memcache.so)并重启php-fpm。

php安装memcache扩展