首页 > 解决方案 > 如何解决我的问题?请帮助我。我想将我的 laravel 项目 5.2 升级到 7。但是作曲家返回这个问题

问题描述

PHP Fatal error:  Uncaught ReflectionException: Class App\Exceptions\Handler does not exist in G:\xampp\htdocs\shomoynews_dynamic\vendor\laravel\framework\src\Illuminate\Container\Container.php:809
Stack trace:
#0 G:\xampp\htdocs\shomoynews_dynamic\vendor\laravel\framework\src\Illuminate\Container\Container.php(809): ReflectionClass->__construct('App\\Exceptions\\...')
#1 G:\xampp\htdocs\shomoynews_dynamic\vendor\laravel\framework\src\Illuminate\Container\Container.php(691): Illuminate\Container\Container->build('App\\Exceptions\\...')
#2 G:\xampp\htdocs\shomoynews_dynamic\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(796): Illuminate\Container\Container->resolve('App\\Exceptions\\...', Array, false)
#3 G:\xampp\htdocs\shomoynews_dynamic\vendor\laravel\framework\src\Illuminate\Container\Container.php(269): Illuminate\Foundation\Application->resolve('App\\Exceptions\\...', Array, false)
#4 G:\xampp\htdocs\shomoynews_dynamic\vendor\laravel\framework\src\Illuminate\Container\Container.php(805): Illuminate\Con in G:\xampp\htdocs\shomoynews_dynamic\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 811
PHP Fatal error:  Uncaught ReflectionException: Class App\Exceptions\Handler does not exist in G:\xampp\htdocs\shomoynews_dynamic\vendor\laravel\framework\src\Illuminate\Container\Container.php:809
Stack trace:
#0 G:\xampp\htdocs\shomoynews_dynamic\vendor\laravel\framework\src\Illuminate\Container\Container.php(809): ReflectionClass->__construct('App\\Exceptions\\...')
#1 G:\xampp\htdocs\shomoynews_dynamic\vendor\laravel\framework\src\Illuminate\Container\Container.php(691): Illuminate\Container\Container->build('App\\Exceptions\\...')
#2 G:\xampp\htdocs\shomoynews_dynamic\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(796): Illuminate\Container\Container->resolve('App\\Exceptions\\...', Array, false)
#3 G:\xampp\htdocs\shomoynews_dynamic\vendor\laravel\framework\src\Illuminate\Container\Container.php(269): Illuminate\Foundation\Application->resolve('App\\Exceptions\\...', Array, false)
#4 G:\xampp\htdocs\shomoynews_dynamic\vendor\laravel\framework\src\Illuminate\Container\Container.php(805): Illuminate\Con in G:\xampp\htdocs\shomoynews_dynamic\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 811

标签: phplaravelupgrade

解决方案


Looks like - for whatever reason - your Exception handler is missing. It should be in app/Exceptions/Handler.php. If it's there, you might have an autoload issue.

If not, it looks like you unintentionally deleted it. You can find the source file (of version 7.x) here:

https://github.com/laravel/laravel/blob/7.x/app/Exceptions/Handler.php

Insert that file to your code.


推荐阅读