centos7 php7.2安装redis扩展,使php能和redis进行通信。
一、安装php7.2
二、下载php7的phpredis扩展库wget http://pecl.php.net/get/redis-4.0.2.tgz
三、解压phpredis扩展库tar -xzvf redis-4.0.2.tgz
cd redis-4.0.2
四、通过phpize生成编译configure配置文件[root@zixuephp redis-4.0.2]# /mnt/php7/bin/phpize
Configuring for:
PHP Api Version: 20170718
Zend Module Api No: 20170718
Zend Extension Api No: 320170718
[root@zixuephp redis-4.0.2]#
五、进行编译前的配置[root@zixuephp redis-4.0.2]# ./configure --with-php-config=/mnt/php7/bin/php-config
六、编译和安装make && make install
七、在php.ini增加扩展extension=redis.sovim php.ini
#文件尾增加下面代码
extension=redis.so
八、指定配置文件重新启动/mnt/php7/sbin/php-fpm -y /mnt/php7/etc/php-fpm.conf -c /mnt/php7/etc/php.ini