Installing Drush on Windows
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
- Install additional applications:
- LibArchive: http://gnuwin32.sourceforge.net/packages/libarchive.htm
Libarchive is a programming library that can create and read several different streaming archive formats, including most popular tar variants, several cpio formats, and both BSD and GNU ar variants.
- GZip: http://gnuwin32.sourceforge.net/packages/gzip.htm
GZip is a compression utility designed to be a replacement for compress. Its main advantages over compress are much better compression and freedom from patented algorithms.
- WGet: http://gnuwin32.sourceforge.net/packages/wget.htm
GNU Wget is a free network utility to retrieve files from the World Wide Web using HTTP and FTP.
- LibArchive: http://gnuwin32.sourceforge.net/packages/libarchive.htm
- 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
-
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\binMySQL 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


If you have an open command window, you will need to reopen it to refresh your path variables.
-
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.

Comments
I followed the instructions, But no success http://drupal.org/node/1357718, I am getting "install profile-error unknown options:--prepare-install,--working-directory "
Can you please help me ?
"Command Prompt shell optimized for Drush" is all that appears when I go to the Windows 7 Pro command prompt. If I start a Drush prompt. When I execute a command like "drush dl drush_make-6.x-2.3", I get "Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 24576 bytes) in D:\ProgramData\Propeople\Drush\includes\bootstrap.inc on line 913"
Any ideas what may be wrong?
Thanks.
This is an awesome post but I struggled with drush make (drupal.org/projects/drush_make) configuration.
Finally got it working following instructions from http://drupal.org/node/1260084
especially part where the drush_make is downloaded:
(type in command prompt): drush dl drush_make-6.x-2.3 (project drush_make contains 0 modules - OK) - will download drush_make in C:\users\user_name\.drush
That was the crucial piece I was missing, the drush_make should be in the users\my_windows_user directory, under .drush (notice the dot in front of .drush folder name)
oooook... what if you drupal installation isn't local and you are starting out with drush... how do I connect drush to the online installation
Great resource. God bless you for such a wonderful step-by-step tutorial.
Was dying to install Drush for very long time. Didnt know its this easy.. May be the blog made it very easy :) Thanks Jocelyn
You Beauty!
The only slight difference I had was in point 4 I didn't need to change anything as it was already pointing to php installed with drush.
The best around!
nice tutorial works like a charm
So, I think I did everything correctly... but I'm getting this message on the command line:
drush
'C:\wamp\bin\php\php5.3.4php.exe' is not recognized as an internal or external c
ommand,
I apologize for my "newbiness" if this is an obvious mistake... but does anyone know what the problem is?
Nevermind! I found it, it was just a missing '\' in the path in the drush.bat file. Sorry... now I feel like an idiot =/ Anyway, thank you so much, this was a great tutorial!
For anyone getting a php5ts.dll missing error and using acquia stack:
http://drupal.org/node/506448#comment-4585172
Thank you for posting this! :D It's just what the doctor ordered.
Drush_make on Windows...
Put drush_make in the following location:
drush/commands/drush_makeFor those unfortunate Windows user (myself include at the moment). Put drush_make in the following location:
drush/commands/drush_makeVery nice, ages waiting to get this to work!!!!
Thank you SO MUCH for this ! I've been looking for a simple way to get Drush to work using the Windows command line (Powershell), and you wrote the first one that ACTUALLY WORKED !
I get the help screen fine but ...
Unable to download drupal-6.19.tar.gz to C:/wamp/www/ from
http://ftp.drupal.org/files/projects/drupal-6.19.tar.gz
An error occurred at function : drush_pm_download
when i use the drush dl command - any suggestions?
Any tips on how to install drush make
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.
Great instructions. Worked first time for xampp just changing paths where necessary. Thanks!
Great, you helped me lots.
Great, just what I needed.
Thanks!
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!
nice installation guide...
thanks!
MMmmmuah! muchas gracias :)
Add New Comment