Skip to content

[DotEnv]: Environment variables in .env are evaluated as empty strings #34598

@Abdull

Description

@Abdull

Symfony DotEnv version(s) affected: v4.3.6 up until at least v4.3.8

Description
Using environment variables in .env files fails.

How to reproduce

  • Create .env file with the following content:
MY_HOSTNAME=${HOSTNAME}

where HOSTNAME is an existing environment variable.

  • Expected result: MY_HOSTNAME will have the value of the HOSTNAME environment variable.
  • Actual result : MY_HOSTNAME has no value.

Additional context
I ran into this problem in the context of TYPO3 9LTS with dependency dotenv-connector:v2.1.2 which has a dependency on symfony/dotenv:^4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions