擴展包的下載地址:https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gzphp
tar xf phpredis-2.2.4.tar.gzhtml
cd phpredis-2.2.4nginx
/usr/local/php/bin/phpizegit
./configure --with-php-config=/usr/local/php/bin/php-configgithub
make && make installredis
看到下圖表示安裝成功:vim
echo "extension=redis.so" >> /etc/php.iniphp-fpm
service php-fpm restart測試
安裝成功spa
寫一個腳本鏈接redis
vim /usr/local/nginx/html/redis.php
測試
成功
若是有報錯,解決方法能夠查看上篇博文