Categories
Personal

Installing drush for drupal 7

Drupal 7 is getting long-in-the-tooth. However, I use it for a couple of sites I manage, so simplifying management of these sites including upgrades/updates and security fixes remains a priority.

Since installing the older version of drush required for drupal 7 wasn’t currently documented, at least for my host (opalstack), this is how I install a global version for all sites installed for a given shell user.

As of this writing the most current version of drush that works with drupal 7 is 8.4.11.

From the command line, for the specific shell user for that app (each app should have its own shell user for security):

mkdir ~/drush
cd ~/drush
composer require drush/drush:8.4.11

To make it work without errors:

Add the following to .bashrc

export PATH=${PATH}:${HOME}/bin:${HOME}/.config/composer/vendor/bin:${HOME}/drush/vendor/bin:

And to .bash_profile

unset module

to make sure everything’s working, on the command line type:

$ drush version
Drush Version : 8.4.11

That’s it!

By Dave

He was born in Canada, but currently lives in Boulder, CO up in Boulder Heights.