0

我正在尝试将 laravel 5.8 升级到 6。我还删除了供应商目录但仍然收到以下错误:

Fatal error: Uncaught RuntimeException: A facade root has not been set. in C:\xampp8.2.0\htdocs\web_kaalo - 5.8\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:258
#0 C:\xampp8.2.0\htdocs\web_kaalo - 5.8\app\Exceptions\Handler.php(44): Illuminate\Support\Facades\Facade::__callStatic('set', Array)
#1 C:\xampp8.2.0\htdocs\web_kaalo - 5.8\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(376): App\Exceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#2 C:\xampp8.2.0\htdocs\web_kaalo - 5.8\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(141): Illuminate\Foundation\Console\Kernel->reportException(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#3 C:\xampp8.2.0\htdocs\web_kaalo - 5.8\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 {main}
  thrown in C:\xampp8.2.0\htdocs\web_kaalo - 5.8\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 258
PHP Fatal error:  Uncaught RuntimeException: A facade root has not been set. in C:\xampp8.2.0\htdocs\web_kaalo - 5.8\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:258
Stack trace:
#0 C:\xampp8.2.0\htdocs\web_kaalo - 5.8\app\Exceptions\Handler.php(44): Illuminate\Support\Facades\Facade::__callStatic('set', Array)
#1 C:\xampp8.2.0\htdocs\web_kaalo - 5.8\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(376): App\Exceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#2 C:\xampp8.2.0\htdocs\web_kaalo - 5.8\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(141): Illuminate\Foundation\Console\Kernel->reportException(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#3 C:\xampp8.2.0\htdocs\web_kaalo - 5.8\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 {main}
  thrown in C:\xampp8.2.0\htdocs\web_kaalo - 5.8\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 258```
4

1 回答 1

0

在您的 composer.json 文件中,您应该有这个:

"laravel/framework": "^6.0",
"php": "^7.2",
"phpunit/phpunit": "^8.0"

然后在控制台中执行composer update,所以如果你在这种情况下使用助手字符串和数组,你需要使用这个命令安装包 laravel/helpers:

composer require laravel/helpers

然后通过调用类的方法来更改助手 Illuminate\Support\StrIlluminate\Support\Arr如果您有其他问题,请在此处分享您的 composer.json 以查看更多详细信息。

于 2021-08-10T06:23:47.243 回答