You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some Drush commands will call exec() to run another Drush command (updatedb seems to be the main one, but there may be others). Somewhere in here either the load.environment.php from the Composer autoloader is not called, or $_ENV is clobbered in some way.
This was discussed in drush-ops/drush#4407 and the solution that worked for others, and works for me, is using $_SERVER in the settings.php file rather than $_ENV. The php.ini directive variables_order is referenced, and indeed, the comments for the directive indicate that in the php.ini-production file that most distros are based off of, Environment variables are not set by default.
The part I'm not clear on is that php-dotenv is manually populating the $_ENV global when it is called (via the autoloaded file), when a new drush process is exec()'d, it's not calling the Composer autoloader? But ENV vars from the parent process are copied into $_SERVER?
Ultimately, this issue is to see what should be done about $_ENV in .env.example, to see if it should be replaced with $_SERVER, getenv(), or just a note about the variables_order directive added.
The text was updated successfully, but these errors were encountered:
@dotsam
I can confirm that phpdotenv in it's current implementation within this project does not work in some cases. We are discussing it in this issue #379
Some Drush commands will call
exec()
to run another Drush command (updatedb
seems to be the main one, but there may be others). Somewhere in here either theload.environment.php
from the Composer autoloader is not called, or$_ENV
is clobbered in some way.This was discussed in drush-ops/drush#4407 and the solution that worked for others, and works for me, is using
$_SERVER
in thesettings.php
file rather than$_ENV
. The php.ini directivevariables_order
is referenced, and indeed, the comments for the directive indicate that in thephp.ini-production
file that most distros are based off of,E
nvironment variables are not set by default.The part I'm not clear on is that php-dotenv is manually populating the
$_ENV
global when it is called (via the autoloaded file), when a new drush process isexec()
'd, it's not calling the Composer autoloader? But ENV vars from the parent process are copied into$_SERVER
?Ultimately, this issue is to see what should be done about
$_ENV
in .env.example, to see if it should be replaced with$_SERVER
,getenv()
, or just a note about thevariables_order
directive added.The text was updated successfully, but these errors were encountered: