我查看了针对类似问题提出的几个答案,但在我的情况下没有任何效果。
仅供引用,这是我在 Laravel 7 中的第一个项目,在我的 Mac 上运行良好。
我已经按照 this article 在我的服务器上部署了该项目.
在网络上运行项目时,出现以下错误:
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
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
我该如何解决?
最佳答案
我终于找到了一个适用于我的案例的解决方案。
composer update
php artisan config:cache
php artisan config:clear
主页现在显示,但路线不起作用...
关于deployment - Laravel 7 fatal error : Uncaught RuntimeException: A facade root has not been set,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61651516/