Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
prog:symfony:configuration:env [19/09/2022 17:07] thierry [Les fichiers .env] |
prog:symfony:configuration:env [20/09/2022 16:57] (Version actuelle) thierry [Depannage] |
||
---|---|---|---|
Ligne 41: | Ligne 41: | ||
<note tip>Exécuter''composer dump-env prod'' pour compiler les fichiers ''.env'' pour une utilisation en production (nécessite symfony/flex >=1.2).\\ | <note tip>Exécuter''composer dump-env prod'' pour compiler les fichiers ''.env'' pour une utilisation en production (nécessite symfony/flex >=1.2).\\ | ||
[[https://symfony.com/doc/current/best_practices.htmsymfony l#use-environment-variables-for-infrastructure-configuration]]</note> | [[https://symfony.com/doc/current/best_practices.htmsymfony l#use-environment-variables-for-infrastructure-configuration]]</note> | ||
+ | |||
+ | ===== Depannage ===== | ||
+ | On peut visualiser le mecanisme avec ''symfony console debug:dotenv'' | ||
+ | |||
+ | <code> | ||
+ | thierry@obi1:/var/www/test$ php bin/console debug:dotenv | ||
+ | |||
+ | Dotenv Variables & Files | ||
+ | ======================== | ||
+ | |||
+ | Scanned Files (in descending priority) | ||
+ | -------------------------------------- | ||
+ | |||
+ | * ⨯ .env.local.php | ||
+ | * ⨯ .env.dev.local | ||
+ | * ⨯ .env.dev | ||
+ | * ⨯ .env.local | ||
+ | * ✓ .env | ||
+ | |||
+ | Variables | ||
+ | --------- | ||
+ | |||
+ | ------------ ---------------------------------- ----------------------------------- | ||
+ | Variable Value .env | ||
+ | ------------ ---------------------------------- ----------------------------------- | ||
+ | APP_ENV dev dev | ||
+ | APP_SECRET 0f363272eae2f703c2d2f0fe1b8db8bd 0f363272eae2f703c2d2f0fe1b8db8... | ||
+ | ------------ ---------------------------------- ----------------------------------- | ||
+ | |||
+ | // Note real values might be different between web and CLI. | ||
+ | </code> | ||
+ | |||