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

silva_carvalho20's avatar

php artisan - PHP Fatal error: Class 'Dotenv' not found in /home/.../bootstrap/app.php on line 5

Hello guys.

I have a Lumen project stored in GuitHub, and when I clone this project and try to run the php artisan command in the terminal inside the project folder, I get the error: PHP Fatal error: Class 'Dotenv' not found in PHP Fatal error: Class 'Dotenv' not found in /home/rafael/IASD/bootstrap/app.php on line 5 I already looked for a lot in the internet but none of the options found gave certain, commands like composer update, composer dump-autoload, did not work in any way, does anyone have a tip to solve? Remembering that the project is loading the file ... /autoload.php This version of my project Lumen is 5.1.* and can be found on the link: https://github.com/silvacarvalho/IASD

Thank you all for the attention

Sorry for the translation, I'm using google translate ... rsrsrss

0 likes
2 replies
linhcodehub's avatar

Run this command:

php artisan clear-compiled

and then:

php artisan dump-autoload

Solved problem for me.

If not, you may need to manually delete vendor directory and composer install again.

pettturu's avatar

Probably the last one needs to be

composer dump-autoload

Please or to participate in this conversation.