[英]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.