- 时间:2022-02-19 09:55 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:Fedora下安装php Redis扩展笔记
[b]一、安装编译工具
[/b]
[url=https://github.com/nicolasff/phpredis]https://github.com/nicolasff/phpredis[/url]
[b]2、找到PHP安装路径[/b]
命令whereis phpize和whereis php-config 找到phpize和php-config路径
[b]3、生成configure[/b]
# /usr/bin/phpize
[b]4、编译安装
[/b]
# ./configure --with-php-config=/usr/bin/php-config
# make && make install
[b]5、加入安装的redis.so模块
[/b]
# vim /etc/php.ini
[b]6、重启apache或nginx[/b]
[b]7、测试[/b]
$redis = new Redis();
$redis->connect('127.0.0.1',6379);
$redis->set('test','hello world!');
echo $redis->get('test');