简体   繁体   English

未捕获的ReflectionException:在/project/vendor/laravel/framework/src/Illuminate/Container/Container.php:721中不存在App \\ Http \\ Kernel类

[英]Uncaught ReflectionException: Class App\Http\Kernel does not exist in /project/vendor/laravel/framework/src/Illuminate/Container/Container.php:721

When I try to run my Laravel project by using 当我尝试通过使用运行Laravel项目时

php -S localhost:8000

or 要么

php artisan serve

it throws this error log 它抛出此错误日志

PHP Fatal error:  Uncaught ReflectionException: Class App\Http\Kernel does not exist in /var/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php:721
Stack trace:
#0 /var/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(721): ReflectionClass->__construct('App\\Http\\Kernel')
#1 /var/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(600): Illuminate\Container\Container->build('App\\Http\\Kernel')
#2 /var/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(567): Illuminate\Container\Container->resolve('App\\Http\\Kernel')
#3 /var/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(708): Illuminate\Container\Container->make('App\\Http\\Kernel')
#4 /var/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(246): Illuminate\Foundation\Application->make('App\\Http\\Kernel', Array)
#5 /var/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(718): Ill in /var/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 721

I have tried deleting vendor folder and reinstalling through composer by using this command 我尝试使用此命令删除供应商文件夹并通过composer重新安装

composer install

but it didn't work. 但这没用。 I have tried to debug and tried all the possible solutions available on this platform but I was unable to resolve the error. 我尝试调试并尝试了该平台上所有可能的解决方案,但无法解决该错误。 I have tried these commands as well 我也尝试过这些命令

 php artisan config:clear
 php artisan cache:clear
 composer update
 composer dump-autoload 

but unfortunetly none of them worked. 但不幸的是,它们都不起作用。 Please help me to solve this issue. 请帮我解决这个问题。

First of all, does App\\Http\\Kernel.php exist? 首先, App\\Http\\Kernel.php存在?

Second, does it get bound to the service container in bootstrap\\app.php ? 其次,它是否绑定到bootstrap\\app.php的服务容器?

It should look like this: 它看起来应该像这样:

// ...Line 28
$app->singleton(
    Illuminate\Contracts\Http\Kernel::class,
    App\Http\Kernel::class
);

$app->singleton(
    Illuminate\Contracts\Console\Kernel::class,
    App\Console\Kernel::class
);

$app->singleton(
    Illuminate\Contracts\Debug\ExceptionHandler::class,
    App\Exceptions\Handler::class
);
// Line 43...

I also did run into class App\\Http\\Kernel.php not found. 我也确实遇到了找不到的App \\ Http \\ Kernel.php类。

Didn't know how but it happens that my http folder had been moved to my project directory. 不知道如何,但是碰巧我的http文件夹已移到我的项目目录中。

A simple copy of the \\Http\\ folder and pasting into the App folder resolved the issue \\ Http \\文件夹的简单副本并粘贴到App文件夹中即可解决此问题

暂无
暂无

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

相关问题 未捕获的ReflectionException:/vendor/laravel/framework/src/Illuminate/Container/Container.php:738中不存在类日志 - Uncaught ReflectionException: Class log does not exist in /vendor/laravel/framework/src/Illuminate/Container/Container.php:738 在vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php 中未捕获的异常“ReflectionException”和消息“类配置不存在” - Uncaught exception 'ReflectionException' with message 'Class config does not exist' in vendor\laravel\framework\src\Illuminate\Container\Container.php Laravel 5.2:/vendor/laravel/framework/src/Illuminate/Container/Container.php:734中不存在类日志 - Laravel 5.2: Class log does not exist in /vendor/laravel/framework/src/Illuminate/Container/Container.php:734 Project\taskApp\vendor\laravel\framework\src\Illuminate\Container\Container.php:879 在 lavarel 中 - Project\taskApp\vendor\laravel\framework\src\Illuminate\Container\Container.php:879 in lavarel Laravel 5.4:Container.php第749行中的ReflectionException:类App \\ Http \\ Controllers \\ Admin \\ ImageGalleryController不存在 - Laravel 5.4 : ReflectionException in Container.php line 749: Class App\Http\Controllers\Admin\ImageGalleryController does not exist 流明5.3:/var/www/project/vendor/illuminate/container/Container.php:749中的“类文件系统不存在” - Lumen 5.3: 'Class filesystem does not exist' in /var/www/project/vendor/illuminate/container/Container.php:749 Laravel Composer错误Uncaught ReflectionException:Container.php中不存在类日志:738 - Laravel Composer error Uncaught ReflectionException: Class log does not exist in Container.php:738 Laravel 5.7升级,未捕获ReflectionException:类缓存不存在Container.php:779 - Laravel 5.7 upgrade, Uncaught ReflectionException: Class cache does not exist Container.php:779 Container.php行749中的ReflectionException:类App \\ Http \\ Controllers \\ registration不存在 - ReflectionException in Container.php line 749: Class App\Http\Controllers\registration does not exist 错误 500 laravel 生产和“/src/Illuminate/Container/Container.php:833 中不存在类视图”nginx 日志错误 - Error 500 laravel production and "Class view does not exist in /src/Illuminate/Container/Container.php:833" nginx log error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM