File tree 2 files changed +13
-7
lines changed
2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -827,24 +827,27 @@ the easiest way to define env vars is by creating a ``.env.local`` file on your
827
827
production server(s) with your production values.
828
828
829
829
To improve performance, you can optionally run the ``dotenv:dump `` command (available
830
- in :ref: `Symfony Flex <symfony-flex >` 1.2 or later). The command is not registered by default.
831
- In order to enable it, you must add it to their services.yaml file :
830
+ in :ref: `Symfony Flex <symfony-flex >` 1.2 or later). The command is not registered
831
+ by default, so you must register first in your services:
832
832
833
833
.. code-block :: yaml
834
834
835
+ # config/services.yaml
835
836
services :
836
837
Symfony\Component\Dotenv\Command\DotenvDumpCommand :
837
838
- ' %kernel.project_dir%/.env'
838
839
- ' %kernel.environment%'
839
840
840
- On PHP >= 8, the two arguments can be removed when autoconfiguration is enabled (which is the default):
841
+ In PHP >= 8, you can remove the the two arguments when autoconfiguration is enabled
842
+ (which is the default):
841
843
842
844
.. code-block :: yaml
843
845
846
+ # config/services.yaml
844
847
services :
845
848
Symfony\Component\Dotenv\Command\DotenvDumpCommand : ~
846
849
847
- Running command:
850
+ Then, run the command:
848
851
849
852
.. code-block :: terminal
850
853
Original file line number Diff line number Diff line change @@ -154,14 +154,17 @@ most natural in your hosting environment.
154
154
155
155
.. code-block :: terminal
156
156
157
- $ php bin/console dotenv: dump prod
157
+ $ composer dump-env prod
158
158
159
- The generated file will contain all the configurations stored in ``.env ``. If you
159
+ The generated file will contain all the configuration stored in ``.env ``. If you
160
160
want to rely only on environment variables, generate one without any values using:
161
161
162
162
.. code-block :: terminal
163
163
164
- $ php bin/console dotenv:dump prod --empty
164
+ $ composer dump-env prod --empty
165
+
166
+ If you don't have Composer installed on the production server, use instead
167
+ :ref: `the dotenv:dump Symfony command <configuration-env-var-in-prod >`.
165
168
166
169
C) Install/Update your Vendors
167
170
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments