laravel / lumen-framework

The Laravel Lumen Framework.
https://lumen.laravel.com
MIT License
1.47k stars 419 forks source link

Sometimes the environment config is not loaded properly #1155

Closed Albvadi closed 3 years ago

Albvadi commented 3 years ago

Description:

Sometimes, randomly, using app()->environment() I get local instead of development (or the value configured in my .env file)

lumen

Steps To Reproduce:

Also, reviewing phpdotenv upgrading guide there is a example code to make dotenv work properly. I have put that code before the LoadEnvironmentVariables in bootstrapp/app.php and it seems to have solved my problem, but again I don't know if it is the correct way or if it should work without adding any additional code.

Thank you.

driesvints commented 3 years ago

Hey there,

Unfortunately we don't support this version anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? We'll help you out and re-open this issue if so.

Thanks!

AnonimBella commented 1 year ago

I got this error too and I solved it by adding dotenv manually in bootstrap.php. I'm using Lumen ^9.0 and PHP 8.0.27