Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught ReflectionException: Class log does not exist in /vendor/laravel/framework/src/Illuminate/Container/Container.php:738

Tags:

php

laravel

I had my Laravel 5.2 working well, I was happy.

Then I executed :

 php artisan config:cache

And my day became darker

I got this message:

PHP Fatal error:  Uncaught ReflectionException: Class log does not exist in /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php:738
Stack trace:
#0 /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): ReflectionClass->__construct('log')
#1 /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php(633): Illuminate\Container\Container->build('log', Array)
#2 /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(687): Illuminate\Container\Container->make('log', Array)
#3 /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php(853): Illuminate\Foundation\Application->make('log')
#4 /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php(808): Illuminate\Container\Container->resolveClass(Object(    ReflectionParameter))
#5 /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php(777): Illuminate\Container\Container->getDependencies(Arr in /home/vagrant/    Code/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 738

Fatal error: Uncaught ReflectionException: Class log does not exist in /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php on line     738

ReflectionException: Class log does not exist in /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 738

Call Stack:
    0.0007     351952   1. {main}() /home/vagrant/Code/artisan:0
    0.2149    2190096   2. Illuminate\Foundation\Console\Kernel->handle() /home/vagrant/Code/artisan:35
    0.2329    2327800   3. Illuminate\Foundation\Console\Kernel->reportException() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Foundation/Console/    Kernel.php:117
    0.2329    2327840   4. Illuminate\Container\Container->offsetGet() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:250
    0.2329    2327840   5. Illuminate\Foundation\Application->make() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php:1178
    0.2329    2327896   6. Illuminate\Container\Container->make() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:687
    0.2329    2327896   7. Illuminate\Container\Container->build() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php:633
    0.2329    2327896   8. Illuminate\Container\Container->Illuminate\Container\{closure}() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/    Container.php:735
    0.2329    2327896   9. Illuminate\Foundation\Application->make() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php:230
    0.2329    2327896  10. Illuminate\Container\Container->make() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:687
    0.2329    2327896  11. Illuminate\Container\Container->build() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php:633
    0.2439    2371256  12. Illuminate\Container\Container->getDependencies() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php:777
    0.2491    2378936  13. Illuminate\Container\Container->resolveClass() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php:808
    0.2491    2378936  14. Illuminate\Foundation\Application->make() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php:853
    0.2491    2378992  15. Illuminate\Container\Container->make() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:687
    0.2491    2378992  16. Illuminate\Container\Container->build() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php:633
    0.2491    2379104  17. ReflectionClass->__construct() /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Container/Container.php:738

I don't really know how to debug it,

I tried to remove anything that I lastely did. Some says it is a .env file with spaces inside, but not in my case, so basically, I don't know how to debug it.

I tried

composer dump-autoload

I tried to delete vendor folder

All php artisan commands fails.

It seems to happen to a lot of people but the cause always different and difficult to debug.

Any help will be appreciated!

EDIT 1: I could restore a functional version of my site deleting

bootstrap/cache/config.php

I also did a php artisan config:cache before it fails

and restoring a previous version of

    bootstrap/cache/services.php

But I would like to use those commands, because they make a significant difference in production!

like image 670
Juliatzin Avatar asked Feb 08 '23 10:02

Juliatzin


1 Answers

As noodles_ftw says, this was a config file issue. so, checking for errors in my config folder did the trick, I had an error in jwt.php

Hope it helps!

like image 124
Juliatzin Avatar answered Feb 10 '23 10:02

Juliatzin