It's been awhile since I've upgraded my server and I'm setting it up from scratch. I'm using Ubuntu 19, apache 2 and PHP 7.2. My site is Drupal 7 which is still running php 5.6 in my old server. I'm in the process of installing drush via the command on the new server:

composer global require drush/drush:8

I'm not sure which version of drush I should be using or if I should even be installing via that method. What version of Drush should I be using for Drupal 7 and am I using the correct PHP version of 7.2?

  • "Please do not install Drush using composer global require" from docs.drush.org/en/8.x/install – 4k4 Jun 28 '19 at 6:20
  • Hey Patoshi, asking to recommend tools is off-topic... – leymannx Jun 28 '19 at 6:43

Drush 9 does not work with drupal 7, but drush 8 does work with it. I installed it by creating a new ubuntu user and making sure composer is installed globally then install cgr via:

composer global require consolidation/cgr

then add to your ~/.bashrc file

export PATH="$HOME/.config/composer/vendor/bin:$PATH"


cgr drush/drush:8.x-dev --prefer-source

link: https://github.com/consolidation/cgr#installation-and-usage

Then I followed the tutorial here: https://docs.drush.org/en/8.x/install-alternative/

Install a global Drush via Composer

Follow the instructions below:

Install Composer globally.

Install the cgr tool following the instructions in that project.

Add composer's bin directory to the system path by placing export PATH="$HOME/.composer/vendor/bin:$PATH" into your ~/.bash_profile (Mac OS users) or into your ~/.bashrc (Linux users).

Install latest stable Drush: cgr drush/drush.

Verify that Drush works: drush status

Please do not install Drush using composer global require. See Fixing the Composer Global command for more information.

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.