一、安装phpize(存在忽略)php
yum install php-devel
二、下载扩展源码包,直接用wget,通常放在 /usr/local/srcgit
wget https://github.com/edtechd/phpredis/archive/php7.zip
3 解压php7.zipgithub
unzip php7.zip
4.解压目录为pphpredis-php7,进入该文件夹,开始编译php扩展redis
cd phpredis-php7
//具体用哪一个要取决于你的phpize文件所在的目录,这时你应该用 whereis phpize 来查看路径/usr/bin/phpize
执行完上一步,咱们就有了 configure 配置文件了。php7
5.配置环境spa
./configure --with-php-config=/usr/bin/php-config
其中 php-config 和 phpize 所在的目录是相同的,好比上面我用 /usr/bin/phpize,则在这一步我用 ./configure –with-php-config=/usr/bin/php-config (其实若是你的php是默认安装路径的话,直接 ./configure 就能够了,我的而言吧)code
6.编译安装blog
make && make install
七、配置php.ini,添加:ip
(配置php的配置文件php.ini(具体放在那里能够用 whereis php.ini 来查看),个人配置文件php.ini在/etc/下)get
extension=redis.so
八、重启php
在php.info中查看redis信息