简体   繁体   English

Laravel 5.5应用程序不再通过“未设置外观根目录”引导。

[英]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.

相关问题 尚未设置外观根。 流明 - A facade root has not been set. in lumen 未捕获的 RuntimeException:尚未设置外观根。 在 Facade.php:258 升级到 Laravel 时 - Uncaught RuntimeException: A facade root has not been set. in Facade.php:258 when upgrading to Laravel 7 如何解决 未设置门面根。 在 Facade.php 第 236 行:Laravel 5.8? - How to solve A facade root has not been set. In Facade.php line 236: Laravel 5.8? Laravel - 尚未设置外观根 - Laravel - A facade root has not been set Laravel 5.4尚未设置立面根 - Laravel 5.4 A facade root has not been set Laravel 5.7:尚未设置外观根 - Laravel 5.7: A facade root has not been set Laravel 6:尚未设置外观根 - Laravel 6 : A facade root has not been set Laravel php artisan config:cache抛出Uncaught RuntimeException:尚未设置外观根。 安装新的作曲家程序包后 - Laravel php artisan config:cache throws Uncaught RuntimeException: A facade root has not been set. After installing new composer package Laravel 5.6 Uncaught RuntimeException:尚未设置外观根。 在vendor / laravel / framework / src / Illuminate / Support / Facades / Facade.php:218中 - Laravel 5.6 Uncaught RuntimeException: A facade root has not been set. in vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:218 获取 RuntimeException:尚未设置外观根。 在 /var/www/html/vendor/.../Illuminate/Support/Facades/Facade.php - Getting RuntimeException: A facade root has not been set. in /var/www/html/vendor/.../Illuminate/Support/Facades/Facade.php
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM