0

I have drupal 7.54 that are placed in /var/www/html which I use as main site. Also I have drupal 8 (for testing) that are placed in /var/www/html/drupal8 where I have drush.

And there is some problem. When I tried to launch command "drush status" it gives me information about drupal 7. And it happens regardless directory of drush.

How to specify version of drupal on which drush must operate?

And I want to notice that I installed drush not via composer but just downloaded and unzipped it.

1

1 Answer 1

0

First I assume you have drush 8 since that is required for both D7 and D8. It's also the default on drush.org.

The best way to deal with multiple Drupal sites is via Drush Aliases.

Basically you create a .drush directory in your home directory and create a aliases.drushrc.php file in it. For each site, have an entry with the minimum information of:

$aliases['d7'] = array (
  'uri' => 'yoursite.dev',
  'root' => '/path/to/drupal/root',
):

There are a lot more options but those are the required ones for local sites.

To use them, run drush commands using the @alias option. E.g.:

drush @d7 status

This will let you switch between multiple local sites.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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