Installing Drush

PHP Composer provides an easier way to install Drush than the method below. Instructions for this can be found in the Drush 8/Drupal 8 version of this article, available here. After installing Composer, run the command php composer.phar global require drush/drush:7.* to install Drush 7.

Procedures for installing Drush on Linux-like machines. The easiest method is through its PEAR channel if available:

$ apt-get install php-pear
$ pear channel-discover pear.drush.org
$ pear install drush/drush
$ drush version

(As of this writing, this gives you Drush version 6.0.)

Installing Drush Without PEAR

It appears that the PEAR Drush channel is going away. If it does disappear for good, you’ll need to use either Composer or a manual procedure for installing Drush:

$ cd /opt
$ git clone https://github.com/drush-ops/drush.git
$ ln -s /opt/drush/drush /usr/sbin/drush

Alternatively you could add the path to Drush to the PATH statement of your .profile or .bashrc. I prefer to just make it accessible system-wide by linking it to the usual places in the PATH statement.

Test that Drush can be seen by your system:

$ which drush
/usr/sbin/drush
$ drush --version
 Drush Version   :  6.2.0

Finally, copy the /path/to/drush/examples/example.drushrc.php file to a location where Drush can see it. I typically put it in /etc/drush/ to provide system-wide aliases.

Loading

Leave a Reply

Your email address will not be published. Required fields are marked *