错误提示
已经安装 redis ,phpinfo 上也有,将 config/app.php 文件的 aliases 的 Redis 也已经注释掉了,路由也清理过了,出现以下错误
local.ERROR: Please remove or rename the Redis facade alias in your “app” configuration file in order to avoid collision with the PHP Redis extension. {“exception”:"[object] (LogicException(code: 0): Please remove or rename the Redis facade alias in your “app” configuration file in order to avoid collision with the PHP Redis extension. at /var/www/blog/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:72)
1.参考官方文档
https://learnku.com/laravel/t/33538
2.直接一步到位
在.env里面加上
REDIS_CLIENT=predis
config/app.php文件的redis 别名不需要注释掉

本文解决了一个在Laravel框架中遇到的问题,即Redis facade别名与PHP Redis扩展之间的冲突。通过修改配置文件和设置环境变量,成功避免了这一冲突,确保了应用程序的正常运行。
2169





