Maxim Mironjuk
-
November 20, 2025
Symfony offers two different mechanisms for configuration, the Dotenv component and parameter bags, which look interchangeable at first glance but actually serve distinct purposes. Mix them up and you get familiar problems: secrets ending up in the Git repository, the same URL maintained in three different places, or a Docker environment variable silently overriding a value in production that a developer had actually set in .env.local. This article clarifies the real .env hierarchy, offers a clear rule of thumb for separating .env from parameters, and explains why sensitive values belong in the secrets vault rather than a plaintext .env file in production.