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