Laravel 6 使用 Redis 注意事项
Laravel 开始推荐使用 phpredis
来代替 predis
。
所以要记得先安装 phpredis
, 然后在 config/app.php
中去掉 Redis
这个别名。
本帖已被设为精华帖!
本帖由系统于 5年前 自动加精
感谢分享
挺好的 phpredis 性能好多了, 而且predis好像没维护了
Predis is no longer maintained by its original author
Issues:
https://github.com/laravel/framework/pull/...
https://github.com/laravel/framework/pull/...
https://github.com/laravel/framework/pull/...
phpredis 好像不支持多版本 php吧
感谢分享Thanks♪(・ω・)ノ
今天升级laravel 6部署到线上的时候也遇到这个问题,感谢分享!!
还有一个坑,缓存时间单位改成秒了
在 config/app.php 中去掉 Redis 这个别名之后,直接报Redis这个类找不到了。
@jiacongcong 记得先安装
phpredis
, 这样Redis
就变成原生函数了怎么安装安装 phpredis啊?按照https://learnku.com/articles/33412这个教程安装,又遇到Mac最新系统的权限问题,现在Mac有了一个比root还要高级的权限。
已经安装了
phpredis
然而在线上依然报Class 'Redis' not found
;