drush-ops / drush

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.
https://www.drush.org
2.33k stars 1.08k forks source link

Drush could not find the alias @local #2535

Open kenpeter opened 7 years ago

kenpeter commented 7 years ago

Original thread: https://drupal.stackexchange.com/questions/224402/drush-could-not-find-the-alias-local

I am using Drupal 8 and Drush 8. I have ~/.drush/local.aliases.drushrc.php. That is the only alias under ~/.drush

Inside local.aliases.drushrc.php, I have

$aliases['local'] = array(
  'root' => '/var/www/html/test/testme/amber/amber_school_dev',
  'uri' => 'http://amber_school_dev.local',
);

Run this drush @local status --debug

Using the Drush script found at /home/kenpeter/.composer/vendor/drush/drush/drush.launcher using pcntl_exec
Cache HIT cid: 8.1.8-commandfiles-0-88373346a2ca94c0c49a48b75b15bd40 [0.02 sec, 3.23 MB]                                                [debug]
$aliases['local'] = array(
  'root' => '/var/www/html/test/testme/amber/amber_school_dev',
  'uri' => 'http://amber_school_dev.local',
);

$aliases['local'] = array(
  'root' => '/var/www/html/test/testme/amber/amber_school_dev',
  'uri' => 'http://amber_school_dev.local',
);

$aliases['local'] = array(
  'root' => '/var/www/html/test/testme/amber/amber_school_dev',
  'uri' => 'http://amber_school_dev.local',
);

Could not find the alias @local [0.06 sec, 6.05 MB]                                                                                 [error]
Undefined index: command notify.drush.inc:60 [0.06 sec, 6.06 MB]                                                                       [notice]
Undefined index: command notify.drush.inc:60 [0.06 sec, 6.06 MB] 

drush sa in site root gives me

@none
@self
default
kenpeter commented 7 years ago

missing the <?php at the beginning of aliases file. That is why. More here: https://drupal.stackexchange.com/questions/224402/drush-could-not-find-the-alias-local/224438#224438