File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -932,6 +932,28 @@ get the environment variables and will not spend time parsing the ``.env`` files
932
932
Update your deployment tools/workflow to run the ``dotenv:dump `` command after
933
933
each deploy to improve the application performance.
934
934
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 `` environment variable to the path and
941
+ filename of the file where the environment variables are stored. Symfony will
942
+ then look for the environment variables in that file, but also in the local
943
+ and 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 environment variable is used to find the files where you
948
+ application environment variable are store, it must be defined at the
949
+ system level (e.g. in your web server configuration) and not in the
950
+ ``.env `` files.
951
+
952
+ .. versionadded :: 7.1
953
+
954
+ The support for the ``SYMFONY_DOTENV_PATH `` environment variable was
955
+ introduced in Symfony 7.1.
956
+
935
957
.. _configuration-secrets :
936
958
937
959
Encrypting Environment Variables (Secrets)
You can’t perform that action at this time.
0 commit comments