[英]Laravel 5.5 application not booting anymore with “A facade root has not been set.”
For some reason one of our applications isn't booting anymore. 由于某种原因,我们的应用程序之一不再引导。 The stack trace looks like this: 堆栈跟踪如下所示:
PHP Fatal error: Uncaught RuntimeException: A facade root has not been set. in /app/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:218
Stack trace:
#0 /app/app/Exceptions/Handler.php(43): Illuminate\Support\Facades\Facade::__callStatic('get', Array)
#1 /app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(352): App\Exceptions\Handler->report(Object(Dotenv\Exception\InvalidFileException))
#2 /app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(123): Illuminate\Foundation\Console\Kernel->reportException(Object(Dotenv\Exception\InvalidFileException))
#3 /app/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 {main}
thrown in /app/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 218
I'm sure there's something that changed and stopped the application from booting. 我确定发生了一些变化,导致应用程序无法启动。 But I have no clue what exactly happened. 但是我不知道到底发生了什么。 Any help is greatly appreciated. 任何帮助是极大的赞赏。
The solution was quiet simple but difficult to find. 解决方案很安静,但很难找到。
.env variables should not be assigned as KEY="VALUE" and also too many spaces can crash the initialisation of the .env .env变量不应分配为KEY =“ VALUE”,并且太多空格可能会破坏.env的初始化
ie: DB_HOST= mysql 即:DB_HOST = mysql
Just correct the .env and it should work like a charme 只需更正.env即可,它应该像魅力一样工作
As a sanity check, completely delete your vendor
directory and then re-install (or update) your dependencies. 作为健全性检查,请完全删除您的vendor
目录,然后重新安装(或更新)您的依赖项。 It is possible a file in there was mistakenly changed and is now causing problems. 可能是其中的文件被错误地更改,现在正在引起问题。
rm -rf vendor
composer update
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.