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

sarfaraz1212's avatar

Unable to change APP_ENV form "local" to "production"

APP_ENV=staging

i have changed it from local to production

Log::info(env('APP_ENV'));
Log::info(message: App::environment());
[2025-07-15 05:50:23] local.INFO: local  
[2025-07-15 05:50:23] local.INFO: local 

but it wont change i also checked the fallback value

 'env' => env('APP_ENV', 'production');

Please guide me where i am going wrong!

1 like
6 replies
Lopsum's avatar

Hi, have you tried clearing the config cache?

php artisan config:clear

1 like
vincent15000's avatar

I had a similar situation.

Have you created a .env.local file ?

If yes, this one is used by default by Laravel instead of the others.

Snapey's avatar

make sure you dont have it twice in your .env file.

also try commenting it out, so that it falls back to production.

1 like

Please or to participate in this conversation.