Play

Installing Drush on Windows

Jocelyn

With ‎Drush‎ you can greatly reduce the amount of time needed to setup and upgrade your Drupal installations - even if you're not a command line expert. If you haven't used Drush yet, you've probably at least heard of it.

This walkthrough will list the steps to get Drush setup on Windows. I'm using WAMP for my localhost. If you're using something else some of your paths might be different, but the setup process is the same.

Drush‎ is a command line shell and Unix scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.

To learn more about getting started with Drush, watch the screencast Drupal School: Jumpstart with Drush and Command Line.

Get Drush

Download the ‎Drush‎ project from drupal.org.

Where to Install Drush?

Drush is not a module, not specific to a Drupal site or Drupal version (5.x, 6.x...). While you can place it in sites/all/modules, it makes more sense to install it outside of your Drupal directory for example in C:/ or C:/wamp/www.

Installation on Windows

  1. Install additional applications:
  2. Use bsdtar for tar, it's more reliable. Copy the file C:\Program Files\GnuWin32\bin\bsdtar.exe to C:\Program Files\GnuWin32\bin\tar.exe

    http://drupal.org/node/594744

  3. Setup PATH environment variables for Drush, PHP, and tar/get/wget binaries installed above:

    Control Panel > System > Advanced System Settings > Environment Variables

    Select Path and click Edit.

    Append your paths (separated by semicolons) to php.exe, drush.bat and tar/get/wget binaries to the Path Variable value. This field is not so usable as a textfield. You'll probably want to copy the existing value to a text editor, append your new entries and paste everything back into the field.

    You're paths should look something like this, but they may be different depending on your setup.

    ;C:\wamp\bin\php\php5.3.0;C:\drush;C:\Program Files\GnuWin32\bin

    MySQL Path

    Check to make sure your Path variable includes the path to the folder containing mysql.exe. While this isn't necessary to use Drush, being able to use MySQL via the command line comes in handy.

    ;C:\wamp\bin\mysql\mysql5.1.36\bin

    System PropertiesEnvironment Variables

    Edit Path System Variable

    If you have an open command window, you will need to reopen it to refresh your path variables.

  4. Edit drush.bat located in the root of your Drush folder to include the full path to your PHP installation.

    @C:\wamp\bin\php\php5.3.0\php.exe "%~dp0drush.php" %*

Testing your Drush Setup

Open the Command Line, type drush or drush --help and hit enter. If installed correctly you should see a help listing of Drush commands.

Command Line

Comments

#1 |
Anonymous
That's awesome, thanks for

That's awesome, thanks for the guide and to Seb for the 'Console_Table' not found error fix.

Had to set this up on a windows box after having to move from a mac setup.

#2 |
Anonymous
Great instructions. Worked

Great instructions. Worked first time for xampp just changing paths where necessary. Thanks!

#3 |
Anonymous

Great, you helped me lots.

#4 |
Anonymous
Great, just what I

Great, just what I needed.

Thanks!

#5 |
Anonymous
for those who get the error

for those who get the error message ""Class 'Console_Table' not found"

go to comment #3 on http://drupal.org/node/563170. Works like a charm!

Thanks for this post Jocelyn!

#6 |
Anonymous
nice installation

nice installation guide...
thanks!

#7 |
Anonymous

MMmmmuah! muchas gracias :)

Add comment

  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags
  • Use one of the forms name.module, name.theme, name.translation, name.installprofile or name.project, in order to link to http://drupal.org/project/name. Note that a link will be generated even if a project does not exist
  • Lines and paragraphs break automatically
  • Each email address will be obfuscated in a human readable fashion or (if JavaScript is enabled) replaced with a spamproof clickable link
  • Websites and email addresses turn into links automatically
  • Insert Google Map macro
  • You may insert videos with [video:URL]
Your email will not be displayed publicly. If you have a Gravatar account, used to display your avatar.

jsfwd on Twitter 

@jsfwd on Twitter »
i heart cycling
RSS Feed