Skip to content

No external ENV variables when running app/console server:run #9298

Closed
@kradecek

Description

@kradecek

$_ENV is empty in my app which is running with php app/console server:run

I need it for accessing external variables described here
http://symfony.com/doc/current/cookbook/configuration/external_parameters.html

so I can use
$ export SYMFONY__DATABASE__USER=user123

// parameters.yml
user: "%database.user%"

Solution for adding external env variables into PHP build-in server is described here
http://stackoverflow.com/questions/13784116/setting-environment-variables-with-the-built-in-php-web-server

I solved it by adding '-d variables_order=EGPCS' in ServerRunCommand.php:95
$builder = new ProcessBuilder(array(PHP_BINARY, '-d variables_order=EGPCS', '-S', $input->getArgument('address'), $router));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions