drupal-composer/drupal-project

.env variables are not loading

sampodina opened this issue · 2 comments

Hi there,

I am experimenting with Drupal 9 on my local machine. I run it through MAMP Pro on a Mac and for some reason, the environment variables are not loaded. I just hardcoded the DB connection in the settings.php to get it running but not sure why it would not load from .env.

Do you have any idea what it could be?

PHP 7.3.22 (cli) (built: Sep 9 2020 17:44:33) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.22, Copyright (c) 1998-2018 Zend Technologies with Xdebug v2.9.6, Copyright (c) 2002-2020, by Derick Rethans

Hi, thanks for reporting the issue. The docs in .env.example where outdated. This has been fixed by #577

Thanks, @webflo using $_ENV instead of getenv() is working.