Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nomi's avatar
Level 1

PHP Fatal error: Uncaught ReflectionException: Class Kernel does not exist

I have a live website that was working fine a couple of days ago but suddenly began to show this error!

Here is the full Stack trace that I get when I view the error_log file

[08-Dec-2021 22:05:06 UTC] PHP Fatal error: Uncaught ReflectionException: Class Kernel does not exist in /home/obhv9r1r3cc9/assign_away_laravel_app/vendor/laravel/framework/src/Illuminate/Container/Container.php:877 Stack trace: #0 /home/obhv9r1r3cc9/assign_away_laravel_app/vendor/laravel/framework/src/Illuminate/Container/Container.php(877): ReflectionClass->__construct('Kernel') #1 /home/obhv9r1r3cc9/assign_away_laravel_app/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\Container\Container->build('Kernel') #2 /home/obhv9r1r3cc9/assign_away_laravel_app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(851): Illuminate\Container\Container->resolve('Kernel', Array, true) #3 /home/obhv9r1r3cc9/assign_away_laravel_app/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\Foundation\Application->resolve('Kernel', Array) #4 /home/obhv9r1r3cc9/assign_away_laravel_app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(836): Illuminate\Container\Container->make('Kerne in /home/obhv9r1r3cc9/assign_away_laravel_app/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 879

I have gone through various answers here but have not been able to fix this issue.

Any ideas on how that issue can be resolved? Thanks in Advance.

0 likes
4 replies
tykus's avatar

First, are there Kernel.php files in app/Http and app/Console directories?

Did you run composer dump-autoload?

Did you mess with the App namespace at all?

nomi's avatar
Level 1

@tykus Yes, there are the Kernel.php files and app/Console directories. Just rechecked them again. Yes, I ran composer dump-autoload and reuploaded all the code to the live server. Nope, I did not mess with the App namespace.

Sinnbeck's avatar

Can you recreate it locally? What is your dev environment? Windows, Mac or Linux?

Please or to participate in this conversation.