Laravel 7致命错误:未捕获RuntimeException:未设置外观根 [英] Laravel 7 Fatal error: Uncaught RuntimeException: A facade root has not been set
问题描述
我查看了针对类似问题的一些答案,但在我的案例中没有任何效果.仅供参考,这是我在Laravel 7中的第一个项目,在Mac上运行良好.我已根据这篇文章在服务器上部署了该项目.在网络上运行项目时,出现以下错误:
I have looked at several answers suggested to a similar issue but nothing worked in my case. FYI, this is my first project in Laravel 7, working fine on my Mac. I have deployed the project on my server following this article. When running the project on the web, I get the following error :
致命错误:未捕获RuntimeException:未设置外观根.在/usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:258
Fatal error: Uncaught RuntimeException: A facade root has not been set. in /usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:258
堆栈跟踪:#0/usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(425):Illuminate \ Support \ Facades \ Facade :: __ callStatic('replaceNamespac ...',数组)#1/usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(402):Illuminate \ Foundation \ Exceptions \ Handler->registerErrorViewPaths()#2/usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(313):Illuminate \ Foundation \ Exceptions \ Handler-> renderHttpException(Object(Symfony\ Component \ HttpKernel \ Exception \ HttpException))#3/usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(210):Illuminate \ Foundation \ Exceptions \ Handler-> prepareResponse(对象(Illuminate \ Http \ Request),对象(Symfony \ Component \ HttpKernel \ Exception \ HttpExcepti)在/usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade中.第258行上的php
Stack trace: #0 /usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(425): Illuminate\Support\Facades\Facade::__callStatic('replaceNamespac...', Array) #1 /usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(402): Illuminate\Foundation\Exceptions\Handler->registerErrorViewPaths() #2 /usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(313): Illuminate\Foundation\Exceptions\Handler->renderHttpException(Object(Symfony\Component\HttpKernel\Exception\HttpException)) #3 /usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(210): Illuminate\Foundation\Exceptions\Handler->prepareResponse(Object(Illuminate\Http\Request), Object(Symfony\Component\HttpKernel\Exception\HttpExcepti in /usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 258
我该如何解决?
推荐答案
我终于找到了适用于我的情况的解决方案.
I finally found a solution that worked in my case.
- 删除文件夹供应商
- 运行
composer更新
- 运行
php artisan config:cache
- 运行
php artisan config:clear
现在显示主页,但路线不起作用...
Home page now displays but the routes do not work...
这篇关于Laravel 7致命错误:未捕获RuntimeException:未设置外观根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!