1.推荐一个php操作redis的使用文档的地址:
https://github.com/phpredis/phpredis/
2.建立一个connect.php文件:
实例化类并连接:
$redis = new Redis();
$redis->connect("127.0.0.1",6379)
3.记得一定要先开启redis server服务,后台执行
redis目录下执行:
./bin/redis-server ./redis.conf
4.运行connect.php文件,无报错就为正常!
php connect.php
原文链接:https://blog.csdn.net/living_ren/article/details/79170615
本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。
还没有人抢沙发呢~