CentOS7 安装PHP7的redis扩展:

 
 
$ tar -zxvf phpredis-4.0.2.tar.gz
 
$ cd phpredis-4.0.2
 
$ /usr/local/php/bin/phpize
 
# php安装后的路径
$ ./configure --with-php-config=/usr/local/php71/bin/php-config
 
$ make && make install
 
#将redis.so添加到php.ini中
$ echo 'extension=redis.so' >> /usr/local/php71/lib/php.ini
或者
extension=  /usr/local/php/lib/php/extensions/no-debug-zts-20160303/redis.so
 
测试:
<?php
//连接本地的 Redis 服务
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->auth('123456');
echo "Connection to server sucessfully";
//查看服务是否运行
echo "Server is running: " . $redis->ping();
 
问题:
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
 
安装依赖 autoconf
$ yum -y install autoconf
原文地址:https://www.cnblogs.com/cshaptx4869/p/10493933.html