简体   繁体   English

未捕获的 RuntimeException:尚未设置外观根。 在 Facade.php:258 升级到 Laravel 时

[英]Uncaught RuntimeException: A facade root has not been set. in Facade.php:258 when upgrading to Laravel 7

I got the error regarding facade even though I followed the laravel upgrade guide即使我遵循了 laravel 升级指南,我仍然收到有关外观的错误

PHP Fatal error:  Uncaught RuntimeException: A facade root has not been set. in D:\Git_Undiksha\legalisir-ijasah-online\vendor\laravel\framework\src\Illuminate\Support\Faca
des\Facade.php:258
Stack trace:
#0 D:\Git_Undiksha\legalisir-ijasah-online\app\Exceptions\Handler.php(39): Illuminate\Support\Facades\Facade::__callStatic('error', Array)
#1 D:\Git_Undiksha\legalisir-ijasah-online\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(366): App\Exceptions\Handler->report(Object(Error))
#2 D:\Git_Undiksha\legalisir-ijasah-online\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(131): Illuminate\Foundation\Console\Kernel->reportException
(Object(Error))
#3 D:\Git_Undiksha\legalisir-ijasah-online\artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Compo
nent\Console\Output\ConsoleOutput))
#4 {main}
  thrown in D:\Git_Undiksha\legalisir-ijasah-online\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 258

Fatal error: Uncaught RuntimeException: A facade root has not been set. in D:\Git_Undiksha\legalisir-ijasah-online\vendor\laravel\framework\src\Illuminate\Support\Facades\F
acade.php:258
Stack trace:
#0 D:\Git_Undiksha\legalisir-ijasah-online\app\Exceptions\Handler.php(39): Illuminate\Support\Facades\Facade::__callStatic('error', Array)
#1 D:\Git_Undiksha\legalisir-ijasah-online\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(366): App\Exceptions\Handler->report(Object(Error))
#2 D:\Git_Undiksha\legalisir-ijasah-online\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(131): Illuminate\Foundation\Console\Kernel->reportException
(Object(Error))
#3 D:\Git_Undiksha\legalisir-ijasah-online\artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Compo
nent\Console\Output\ConsoleOutput))
#4 {main}
  thrown in D:\Git_Undiksha\legalisir-ijasah-online\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 258

Facade.php:258外观.php:258

public static function __callStatic($method, $args)
{
    $instance = static::getFacadeRoot();

    if (! $instance) {
        throw new RuntimeException('A facade root has not been set.');
    }

    return $instance->$method(...$args);
}

Here is my composer.json:这是我的作曲家.json:

"require": {
    "php": ">=7.2.5",
    "laravel/framework": "^7.0",
    "nunomaduro/collision": "^4.1",
    "laravel/tinker": "^2.0",
    "facade/ignition": "^2.0"
},
"require-dev": {
    "composer/composer": "^1.10",
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "^9.1"
},

I did change the Handler.php Exception to Throwable, session.php secure env from false to null, and set any handle() command return to integer. I did change the Handler.php Exception to Throwable, session.php secure env from false to null, and set any handle() command return to integer.

How do I solve the facade error and what should I do?如何解决外观错误,我该怎么办?

After making a new working Laravel version 7 project, copy the app and config folders to the new one (for testing purpose), renaming a file and then testing with php artisan --version every changes I made (rename each no-numbered files to (1) and (2) files to no-numbered), finally I found out what is the problem: config/excel.php在制作一个新的 Laravel 版本 7 项目后,将 app 和 config 文件夹复制到新的(用于测试目的),重命名一个文件,然后使用php artisan --version我所做的每个更改进行测试(将每个无编号文件重命名为(1)和(2)文件无编号),最后我发现了问题所在:config/excel.php

in excel.php I commented autosize-method and it works!在 excel.php 我评论了 autosize-method 并且它有效!

// 'autosize-method'             => PHPExcel_Shared_Font::AUTOSIZE_METHOD_APPROX,

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 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 如何解决 未设置门面根。 在 Facade.php 第 236 行:Laravel 5.8? - How to solve A facade root has not been set. In Facade.php line 236: Laravel 5.8? 获取 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 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 尚未设置外观根。 流明 - A facade root has not been set. in lumen 致命错误:未捕获RuntimeException:尚未设置外观根 - Fatal error: Uncaught RuntimeException: A facade root has not been set 在共享主机上使用 Laravel 项目部署错误(未捕获的 RuntimeException:尚未设置外观根) - Deploy error with Laravel project on Shared Hosting (Uncaught RuntimeException: A facade root has not been set) 将 Laravel 从 5.7 更新到 5.8 会导致此错误:致命错误:未捕获的运行时异常:尚未设置外观根 - updating Laravel from 5.7 to 5.8 results in this error: Fatal error: Uncaught RuntimeException: A facade root has not been set “RuntimeException:尚未设置立面根” - "RuntimeException: a facade root has not been set" Laravel 5.4尚未设置立面根 - Laravel 5.4 A facade root has not been set
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM