Skip to content

[Dotenv] Fatal error for valid environment variable syntax. #31530

@dspiegel

Description

@dspiegel

Symfony version(s) affected: 4.2.8

Description
Dotenv returns error for valid environment variable syntax.

How to reproduce

  1. Add variable to .env like FOOBAR="${FOOBAR:=production}"
  2. Run ./bin/console cache:clear

Error:
Script cache:clear --no-warmup --env %PUBLIC_DIR% returned with error code 255
Fatal error: Uncaught Symfony\Component\Dotenv\Exception\FormatException: Unclosed braces on variable expansion in "/export/home/dave/Projects/iprd/4.2/iprd-tools/.env" ...${SYMFONY_ENV:=dev}

Bash test of .env file works as expected
$ unset FOOBAR
$ . .env
$ echo $FOOBAR
production

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy