« Summary of mapping modules in Drupal | Main | Post-Installation Notes on using Drush »

September 10, 2010

How To Install Drush

Here are my notes on getting drush installed on my dev machine:

1) Get installation directions (inside README.txt) by going to the Drush FAQ. Read instructions.

2) Download the latest version of Drush from the project page.
$ sudo wget http://download.pear.php.net/package/Console_Table-1.1.3.tgz

3) Unpack the tar.gz into your desired directory. I put it in /opt (not sure if that is recommended practice though.)

$ cd /opt/
$ sudo mv drush-6.x-3.3.tar.gz /opt/
$ sudo tar -xzf drush-6.x-3.3.tar.gz

4) Make the drush command executable
$ sudo chmod u+x /opt/drush/drush
$ sudo ln -s /opt/drush/drush /bin/drush

5) Check if drush is working
$ drush help

I got this error at first:
exec: 53: php: not found

The fix, for me, was buried in this tutorial:

If you get an "exec: 53: php: not found" error after running the last line ("sudo drush dl drush_make") you might have to install the PHP command line interface, with

sudo apt-get install php5-cli

From: http://groups.drupal.org/node/70268

6) Check if drush is working, again:
$ drush help

New (but helpful!) error:

PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0
Drush needs a copy of the PEAR Console_Table library in order to [error]
function, and the attempt to download this file automatically failed
because you do not have permission to write files in
/opt/drush/includes. To continue you will need to download the 1.1.3
package from http://pear.php.net/package/Console_Table, extract it,
and copy the Table.php file into Drush's directory as
Drush could not execute.

6) Do what the Error Message tells you to do:
- Download the PEAR Console_Table library

$ sudo wget http://download.pear.php.net/package/Console_Table-1.1.3.tgz
$ sudo tar -xzf Console_Table-1.1.3.tgz
$ sudo mv Console_Table-1.1.3/Table.php /opt/drush/includes/table.inc

7) Check if drush is working, yet again:
$ drush help

8) Success, next step is to learn drush commands.

Posted by kkwaiser at September 10, 2010 09:38 AM


Login to leave a comment. Create a new account.