https://github.com/nicolasff/phpredis
2、找到PHP安装路径
命令whereis phpize和whereis php-config 找到phpize和php-config路径
3、生成configure
# /usr/bin/phpize
4、编译安装
# ./configure --with-php-config=/usr/bin/php-config
# make && make install
5、加入安装的redis.so模块
# vim /etc/php.ini
6、重启apache或nginx
7、测试
$redis = new Redis();
$redis->connect('127.0.0.1',6379);
$redis->set('test','hello world!');
echo $redis->get('test');
«
»