How to Trouble-shoot and Evaluate Environment Variables

This page explains how to trouble-shoot and evaluate environment variables

Environment Variables set in the Command Line

The first thing to note is that any setting for a variable on the command line overrides what is defined in any .env file. So, depending on your problem, check your crontabs and scripts for any 'hidden' variable settings.

Is there a .env.local.php File?

An .env.local.php file is generated by the `bin/console dotenv:dump' command, typically within your deployment pipeline. If an .env.local.php file exists, then its definitions take precedence over any other .env file. Either apply your changes to the .env.local.php file (which makes them non-persistent), or delete the .env.local.php file and apply your changes to .env. .env.local, .env.dist or .env.dist.local (depending on whether you want your changes to eventually go to the repo or not).

Evaluate .env Files

The bin/console debug:dotenv command is your friend. Remember, though, that anything shown here will be overwritten by one of the two methods above - and, worst of all, its effects won't be shown here!

Last updated