如何撤消命令"php artisan config:cache"的效果? [英] How to undo the effect of command "php artisan config:cache"?

查看:40
本文介绍了如何撤消命令"php artisan config:cache"的效果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我(错误地)在本地开发设置中运行命令 php artisan config:cache ,由于该操作,所有调用(来自我的控制器)对 .env 文件(例如 $ _ ENV ['APP_ENV'] $ _ ENV ['ELS_INDEX'] 等)导致以下结果错误:

I (by mistake) run the command php artisan config:cache in my local development setup, due to which all the calls(from my controllers) to the variables defined in .env file (like $_ENV['APP_ENV'], $_ENV['ELS_INDEX'], etc) are resulting in following errors :

MainController.php中的ErrorException 470行 < ----这是.env变量所在的行
未定义索引:APP_ENV

ErrorException in MainController.php line 470 <---- This is the line where .env variable is called
Undefined index: APP_ENV

这是以下链接:配置缓存

请帮助我纠正此问题.预先感谢.

Please help me rectify this issue. Thanks in advance.

推荐答案

要么运行

php artisan config:clear

或从您的Laravel项目中删除文件/bootstrap/cache/config.php .

or remove the file /bootstrap/cache/config.php from your Laravel project.

( php artisan config:cache 创建/bootstrap/cache/config.php )

这篇关于如何撤消命令"php artisan config:cache"的效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆