首页 > 系统服务 > 详细

laravel config:cache 后的小坑

时间:2020-03-04 22:39:10      阅读:85      评论:0      收藏:0      [点我收藏+]

  laravel 使用 php artisan config:cache 后 系统就会读取所有的配置文件集中到一起写入缓存,那么如果代码中 使用 env() 辅助函数获取 .env 里面的配置项就不起作用了!!

引用文档原话:If you execute the config:cache command during your deployment process, you should be sure that you are only calling the env function from within your configuration files. Once the configuration has been cached, the .env file will not be loaded and all calls to the env function will return null.

laravel config:cache 后的小坑

原文:https://www.cnblogs.com/songlen/p/12416627.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!