简体   繁体   中英

Fatal error: Uncaught ReflectionException: Class "env" does not exist

After lunching the command php artisan optimize , i got

fatal error: Uncaught ReflectionException: Class "env" does not exist

I have tried deleting the bootstrap/cache/ and runing composer update but nothing works, everytime i tried to run a php artisan command/composer command i got the same problem. am really stuck. any help.

You can clear cache using:

php artisan optimize:clear

Or only clear config cache using:

php artisan config:clear

https://dev.to/kenfai/laravel-artisan-cache-commands-explained-41e1

Maybe you have something wrong in your config/database.php file. If it is the case when you run composer update the console will show some error at the end of execution due the config/database.php file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM