Install/Upgrade a global Drush
# Browse to https://github.com/drush-ops/drush/releases and download the drush.phar attached to the latest 8.x release. # Test your install. php drush.phar core-status # Rename to `drush` instead of `php drush.phar`. Destination can be anywhere on $PATH. chmod +x drush.phar sudo mv drush.phar /usr/local/bin/drush # Optional. Enrich the bash startup file with completion and aliases. drush init
- MAMP users, and anyone wishing to launch a non-default PHP, needs to edit ~/.bashrc so that the right PHP is in your $PATH.
- We have documented alternative ways to install, including Windows.
- If you need to pass custom php.ini values, run
php -d foo=bar drush.phar --php-options=foo=bar
- Your shell now has useful bash aliases and tab completion for command names, site aliases, options, and arguments.
- A drushrc.php has been copied to ~/.drush above. Customize it to save typing and standardize options for commands.
- Upgrade using this same procedure.
Install a site-local Drush
In addition to the global Drush, it is recommended that Drupal 8 sites be built using Composer, with Drush listed as a dependency.
- When you run
drush, the global Drush is called first and then hands execution to the site-local Drush. This gives you the convenience of running
drushwithout specifying the full path to the executable, without sacrificing the safety provided by a site-local Drush.
- Optional: Copy the examples/drush.wrapper file to your project root and modify to taste. This is a handy launcher script; add --local here to turn off all global configuration locations, and maintain consistency over configuration/aliases/commandfiles for your team.
- Note that if you have multiple Drupal sites on your system, it is possible to use a different version of Drush with each one.
Please see: https://www.drush.org/latest/install/#drupal-compatibility
EOL date for Drush 8 tbd, but estimated to be in concert with Drupal 7 EOL.