Improvements to the Handling of .env Files for all Symfony Versions

This public link is valid for 7 days and shares a thread, including any personal information you added. This link or copies made by others cannot be deleted. If you share with third parties, their policies apply. Can’t copy the link right now. Try again later.

In your CI (GitHub Actions, GitLab CI, Jenkins), you don't want .env.dist.local to be used because CI should mimic production.

Some configurations are only relevant on a developer's local machine. For example, you might want to enable a verbose debugging toolbar, route emails to a local Mailpit instance instead of SendGrid, or toggle a mock payment gateway.

: Double-check that .env.dist.local only contains placeholders, public defaults, or dummy values.

Add these lines to your .gitignore :