@@ -126,21 +126,29 @@ While developing locally, you'll usually store these in ``.env`` and ``.env.loca
126
126
127
127
1. Create "real" environment variables. How you set environment variables, depends
128
128
on your setup: they can be set at the command line, in your Nginx configuration,
129
- or via other methods provided by your hosting service.
129
+ or via other methods provided by your hosting service;
130
130
131
- 2. Or, create a ``.env.local `` file like your local development (see note below)
131
+ 2. Or, create a ``.env.local `` file like your local development.
132
132
133
133
There is no significant advantage to either of the two options: use whatever is
134
134
most natural in your hosting environment.
135
135
136
- .. note ::
136
+ .. tip ::
137
+
138
+ You might not want your application to process the ``.env.* `` files on
139
+ every request. You can generate an optimized ``.env.local.php `` which
140
+ overrides all other configuration files:
141
+
142
+ .. code-block :: terminal
143
+
144
+ $ composer dump-env prod
137
145
138
- If you use the ``.env.* `` files on production, you may need to move your
139
- `` symfony/dotenv `` dependency from `` require-dev `` to `` require `` in `` composer.json `` :
146
+ The generated file will contain all the configuration stored in ``.env ``. If you
147
+ want to rely only on environment variables, generate one without any values using :
140
148
141
149
.. code-block :: terminal
142
150
143
- $ composer require symfony/dotenv
151
+ $ composer dump-env prod --empty
144
152
145
153
C) Install/Update your Vendors
146
154
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments