Installing Drush 8
You are here
Installation:
Drupal 8 development as it requires Drush 8. Using Composer is far and away the easiest method to install Drush.
First install Composer globally.
$ curl -sS https://getcomposer.org/installer | php $ mv composer.phar /usr/local/bin/composer
Now add Composer's directory to your path by editing your .bash_profile
$ export PATH="$HOME/.composer/vendor/bin:$PATH"
Reload your terminal or just re-source the configuration you just added.
$ source ~/.bash_profile
Now that you have Composer working, you can install latest Drush.
$ composer global require drush/drush:dev-master
At the time of writing this article, you'd get Drush 9.x with the above command. If however you'd like Drush 8, use the following:
composer global require drush/drush:8.*
You probably need to note the compatibility of Drupal versions with the Drush versions. Visit the URL below to take note:
http://docs.drush.org/en/master/install/#drupal-compatibility
Keep Drush up to date.
$ composer global update
Then you can check if the update has been successful by executing: (Some versions of Drush have different commands compatibility, the ones in this tutorial work with Drush 8.*
$ drush --version
Now, let’s begin with Drush. First we'll use Drush to download, install and run Drupal 8:
$ drush dl drupal 8-x --select
If you found any errors, and need to re-install Drush, try the following:
$ vim ~/.composer/composer.json # Removed the line containing drush $ composer global update $ composer global require drush/drush:8.*
Sources/References & crucial links
- http://valuebound.com/resources/blog/Installing-drupal-with-drush-the-ba...
- https://github.com/drush-ops/drush/issues/2006#issuecomment-190255285
- https://www.zyxware.com/articles/5356/how-to-list-disable-enable-multipl...
- https://drupal.stackexchange.com/questions/83724/how-do-i-disable-enable...
- http://docs.drush.org/en/master/commands/#global-drush-commands
- https://another.ink/journal/managing-drupal-8-website-using-composer