Symfony dosnt在Symfony-Console bin / console中使用.env.local

时间:2019-05-12 04:30:41

标签: console environment-variables symfony-4.3

Symfony issus?

我在Symfony应用程序中的终端php bin /控制台make:migration中运行,但显示数据库连接错误:

 An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'db_user'@'172.24.0.1' (using password: YES)

bin /控制台文件

if (!isset($_SERVER['APP_ENV'])) {
    if (!class_exists(Dotenv::class)) {
        throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
    }
    (new Dotenv())->load(__DIR__.'/../.env');
}

我不会使用.local.env不是symfony代码中的错误

0 个答案:

没有答案