Skip to content

Instantly share code, notes, and snippets.

@alan-ps
Last active October 5, 2018 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alan-ps/c3ef28f625eb10ba31dc5dc996220846 to your computer and use it in GitHub Desktop.
Save alan-ps/c3ef28f625eb10ba31dc5dc996220846 to your computer and use it in GitHub Desktop.
Installing drush using composer

Install Drush using Composer

1. Install composer globally

Detailed information about this step can be found here.

2. Drush installation

composer global require drush/drush:8.*
composer global update

We can state any Drush version we need. We can also roll back to a necessary release version of Drush using commands above. Now, we can use Drush:

drush version

Don't panic, if you are getting the next message after performing commands above:

The program 'drush' is currently not installed. You can install it by typing: sudo apt install drush

It means that appropriate executable file can't be found. We can fix it by performing one of the following:

  1. Put appropriate folder on the PATH environment variable:
export PATH="$PATH:$HOME/.composer/vendor/bin"
  1. Add an alias to the ~/.bashrc file, i.e:
alias drush='php ~/.composer/vendor/drush/drush/drush.php'

Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment