1

I have 3 Drupal sites installed and I've developed a simple "hello-world" command that just does the following:

drush_log(getmypid() . ' Hello world!', 'ok');

When I run drush @sites hello-world I get the following error message:

Could not find a Drupal settings.php file at sites/default/settings.php

Please note that the command is working fine when run for a specific site.

drush -l test1 hello-world

I was under the assumption that Drush @sites alias should be available by default. Is it not?

  • 1
    I presume from your second example that you have set your --root, perhaps implicitly via cd /path/to/drupal. @sites should work as you have described. What version of Drush are you using? Please try again with today's master, and file a bug if it's still not working correctly. – greg_1_anderson Mar 17 '15 at 16:36
1

I just tested this on HEAD of today's master branch of drush, and drush @sites status worked fine for me with no sites/default folder. Try upgrading to drush 7.0-alpha9.

0

Do you have a site at sites/default or do you only have 3 subsites that are in 3 other folders?

@sites (i believe) makes certain assumptions. Such as "there is a default site directory" and others ... If your site folders are structured otherwise then you need to something like:

drush @test1 hello-world

Also note that aliases are defined in Drush Site Alias files. So for example my @test1 alias would need to be defined previously for drush.

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.