Search code examples
phpdockerlumen

Why are Lumen environment variables out of date (or mismatched?)


So for some reason my lumen .env variables, when echoed out on the backend, don't match what I have in the actual file.

for instance, APP_DEBUG is set to true in the file but when I echo it out I get false or null. Also, if I try to change the APP_NAME nothing happens, it echoes out an outdated value.

I have tried running php artisan cache:clear but that doesn't seem to work either. For what it's worth I'm running this in a docker environment, not sure if that would affect things. Also I'm running php 7.3 with Lumen 6.0.


Solution

  • Well, the issue was indeed docker related.

    It turns out that our environment has all .env related properties defined in the docker-compose.yml file, which was overwriting stuff. so I just had to change this:

    environment:
      <<: *environment
      APP_NAME: <old value>
      APP_URL: http://auth.172.17.0.1.nip.io
    

    and add APP_DEBUG to it as well as modify APP_NAME. So if anyone else runs into this and you're using docker, make sure that docker isn't overwriting the env properties.