I have a Drupal 9 site using multisite to support both local and production hosts. I have defined them in sites/sites.php:
$sites['www.electronovelty.com'] = 'www.electronovelty.com';
$sites['www.en9-local.pglatz.com'] = 'www.en9-local.pglatz.com';
and created settings files in
sites/www.electronovelty.com/settings.php
sites/www.en9-local.pglatz.com/settings.php
Using xdebug, I've verified when opening the two web sites that the correct settings.php is used. But when I try to run drush 11, it is using settings from sites/default/settings.php for some reason:
% drush cr -v
[info] Starting bootstrap to site
[info] Drush bootstrap phase 2
[info] Try to validate bootstrap phase 2
[info] Try to validate bootstrap phase 2
[info] Try to bootstrap at phase 2
[info] Drush bootstrap phase: bootstrapDrupalRoot()
[info] Change working directory to /Users/pglatz/dev/electronovelty/en9-www/web
[info] Initialized Drupal 9.3.12 root directory at /Users/pglatz/dev/electronovelty/en9-www/web
[info] Try to validate bootstrap phase 2
[info] Try to bootstrap at phase 2
[info] Drush bootstrap phase: bootstrapDrupalSite()
[info] Initialized Drupal site default at sites/default
[success] Cache rebuild complete.
I tried specifying the uri, and it finds the correct settings.php, but I'm also getting a "command nt found" error, which I do not understand:
% drush -l www.en9-local.pglatz.com -v cr
[info] Starting bootstrap to site
[info] Drush bootstrap phase 2
[info] Try to validate bootstrap phase 2
[info] Try to validate bootstrap phase 2
[info] Try to bootstrap at phase 2
[info] Drush bootstrap phase: bootstrapDrupalRoot()
[info] Change working directory to /Users/pglatz/dev/electronovelty/en9-www/web
[info] Initialized Drupal 9.3.12 root directory at /Users/pglatz/dev/electronovelty/en9-www/web
[info] Try to validate bootstrap phase 2
[info] Try to bootstrap at phase 2
[info] Drush bootstrap phase: bootstrapDrupalSite()
[info] Initialized Drupal site www.en9-local.pglatz.com at sites/www.en9-local.pglatz.com
sh: ^www.en9-local.pglatz.com$: command not found
[success] Cache rebuild complete.
Where is that error coming from, and what does it mean?