cd /usr/local/src
wget https://github.com/nicolasff/phpredis/archive/master.zip
unzip master.zip
cd phpredis-master
/usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
#执行完make install后会生成
#Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
#修改php.ini
vi /etc/php.ini
#查找extension_dir,修改为(734行)
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
#添加redis(865行)
extension = redis.so
#重启nginx,php-fpm
service nginx restart
重启php-fpm服务
pkill -9 php
/usr/local/php/sbin/php-fpm 此次是5.6版本,详情请看:php5.3.3后版本变化
/usr/local/php/bin/php -m 查看是否加载了该模块