File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -932,6 +932,27 @@ get the environment variables and will not spend time parsing the ``.env`` files
932932 Update your deployment tools/workflow to run the ``dotenv:dump `` command after
933933 each deploy to improve the application performance.
934934
935+ Store Environment Variables In Another File
936+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
937+
938+ By default, the environment variables are stored in the ``.env `` file located
939+ at the root of your project. However, you can store them in another file by
940+ setting the ``SYMFONY_DOTENV_PATH `` env var to the path and filename of the
941+ file where the environment variables are stored. Symfony will then look for
942+ the environment variables in that file, but also in the local and
943+ environment-specific files (e.g. ``.*.local `` and
944+ ``.*.<environment>.local ``). You can find more information about this
945+ in the :ref: `dedicated section <configuration-multiple-env-files >`.
946+
947+ Because this env var is used to find the the files where you application env
948+ var are store, it must be defined at the system level (e.g. in your web server
949+ configuration) and not in the ``.env `` files.
950+
951+ .. versionadded :: 7.1
952+
953+ The support for the ``SYMFONY_DOTENV_PATH `` env var was introduced in
954+ Symfony 7.1.
955+
935956.. _configuration-secrets :
936957
937958Encrypting Environment Variables (Secrets)
You can’t perform that action at this time.
0 commit comments