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

Presto's avatar

After Commit - Fatal error: Class 'Dotenv' not found

Hello everyone,

I'm trying to push an update to my site but I'm getting this error on my site and in forge:

Fatal error: Class 'Dotenv' not found in /home/forge/ipgeo.io/bootstrap/cache/compiled.php on line 1980
0 likes
6 replies
jhoff's avatar

Dotenv is the library that parses the .env file for laravel, so it would be one of the first things needed by the framework. Maybe composer's autoloader is messed up.

Does composer dump-autoload --no-scripts help?

Presto's avatar

No go, did not work :( I may just uninstall the repository, that is a pain, blah!

Presto's avatar
Presto
OP
Best Answer
Level 6

Yeah, uninstalling and reinstalling the repository fixed the issue.

1 like
qamrulhaque's avatar

Check laravel log file to see which vendor file is throwing the error. Delete repository from vendor folder which is throwing error and run composer install.

Please or to participate in this conversation.