Symfony can't find environment variable in the secrets

Viewed 434

I have the same problem as asked here.

Followed Symfony Secrets Docu exactly as described.

  1. Generated the keys.
  2. Created the secret variable - php bin/console secrets:set APPLICATION_SECRET_KEY
  3. The variable is there with the right value - php bin/console secrets:list --reveal
  4. Added the following parameter to services.yaml parameters: myapp.application_secret_key: '%env(APPLICATION_SECRET_KEY)%'
  5. Trying to access the key from the controller by - $apiSecret = $this->getParameter('myapp.application_secret_key');

which results in an "not found" exception:

Environment variable not found: "APPLICATION_SECRET_KEY".

Any idea what I am missing?

0 Answers
Related