php扩展memcache的作用是为了支持memcached数据库缓存服务器,下面是安装方法。
1、下载
下载地址:http://pecl.php.net/package/memcache
文件名:memcache-3.0.8.tgz
文件下载成功后上传至/usr/local目录
2、安装
tar -zxvf memcache-3.0.8.tgz
cd memcache-3.0.8
执行:
/usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir
make
make install
Installing shared extensions: ls /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/
ll ls /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/
出现上图memcache.so就表明安装成功了。
3、配置支持php
添加vi /usr/local/php/lib/php.ini
extension=memcache.so
保存退出。
4、重启服务
/etc/init.d/php-fpm restart #重启php
service nginx restart #重启nginx
查看phpinfo可以看到支持了