3

I am usin 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]                                                                       [notice]

drush sa in site root gives me

@none
@self
default
  • did you also clear the drush cache druch cc drush? Additionally you can run drush status to see if it found your alias file. – Neograph734 Jan 3 '17 at 10:31
5

You are missing the <?php at the beginning of your aliases file. That's why the contents of your file are printing out when Drush tries to load them.

1

The aliases are recognized by Drush using the file names prefixed with the alias name.

You could try drush @local.local status --debug

First local from @local.local is the comes from the file name local.aliases.drushrc.php, and the second is the key of the $aliases array from the file.

To see a list of all the aliases present on the system, you would use drush sa.

  • I am using drupal 8 with drush 8. drush @local.local status --debug gave me the same error. cd into /var/www/html/test/testme/amber/amber_school_dev, error is Could not find a site definition. drush sa within site root is none, self, default – kenpeter Jan 3 '17 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.