This article is mainly to share with you the Linux installation of the Redis extension of the method, I hope to help everyone.
1. Download Phpredis
Download Address: https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz
2. Installing Redis
Upload the phpredis-2.2.4.tar.gz to the/USR/LOCAL/SRC directory, then execute the command in turn:
CD/USR/LOCAL/SRC #进入软件包存放目录
Tar zxvf phpredis-2.2.4.tar.gz #解压
CD phpredis-2.2.4 #进入安装目录
/usr/local/php/bin/phpize #用phpize生成configure配置文件
./configure--with-php-config=/usr/local/php/bin/php-config #配置
Make #编译
Make install #安装
After the installation is complete, the following installation path appears
/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/
Make Test #测试
You will be prompted to configure the php.ini file
3. Configure PHP Support
Vim/usr/local/php/etc/php.ini #编辑配置文件, add the following on the last line
extension= "Redis.so"
4. Restart Service
sudo service nginx restart
SUDO/ETC/INIT.D/PHP-FPM restart
Viewing phpinfo information from the browser see a redis extension, which means the installation was successful