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

simplenotezy's avatar

Laravel says application is in production, even though it is not.

When I run php artisan env it says my current environment is production even though it is not. I have edited my .env file to APP_ENV=local.

If I run env('APP_ENV') it says LOCAL. But if I var_dump $_ENV the APP_ENV is not present in the array, however all other ENV variables are. However, this behavior is the same for my other project that works fine, so I guess its meant to be hidden from the $_ENV array.

  • I have tried clearing all caches (config:clear, cache:clear, route:clear, view:clear).
  • I have tried restarting my local machine
0 likes
0 replies

Please or to participate in this conversation.