File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 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
827827production server(s) with your production values.
828828
829829To 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:
832832
833833.. code-block :: yaml
834834
835+ # config/services.yaml
835836 services :
836837 Symfony\Component\Dotenv\Command\DotenvDumpCommand :
837838 - ' %kernel.project_dir%/.env'
838839 - ' %kernel.environment%'
839840
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):
841843
842844.. code-block :: yaml
843845
846+ # config/services.yaml
844847 services :
845848 Symfony\Component\Dotenv\Command\DotenvDumpCommand : ~
846849
847- Running command:
850+ Then, run the command:
848851
849852.. code-block :: terminal
850853
Original file line number Diff line number Diff line change @@ -154,14 +154,17 @@ most natural in your hosting environment.
154154
155155 .. code-block :: terminal
156156
157- $ php bin/console dotenv: dump prod
157+ $ composer dump-env prod
158158
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
160160 want to rely only on environment variables, generate one without any values using:
161161
162162 .. code-block :: terminal
163163
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 >`.
165168
166169C) Install/Update your Vendors
167170~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments