Drush installation for Windows, configuration. Working with Drupal from the command line.
To install Drush on Windows, use the installer:
http://www.drush.org/drush_windows_installer
Everything below is outdated.
Downloading, installing, and enabling modules, downloading, installing, and enabling themes — these are repetitive tasks during website development. To save time, the command-line interface Drush was created. Drush helps install and enable a module with just a couple of lines in the command prompt. So, let’s spend a few minutes studying this article to save hours of time later.
The home page of the drush project is http://drush.ws. On this website, you’ll find a lot of useful information on how to use this utility.
Drush is not a Drupal module. Drush is a set of commands that simplifies working with Drupal installations. To use Drush, you need a command-line interface (console). It works best with Linux, but it’s also possible to use Drush on Windows.
Let’s begin installing Drush on Windows.
Installing Drush on Windows
1. Download the latest version of drush from drupal.org.
2. Drush is not a module, so you should not copy it into sites/all/modules. If you're using Denwer, it’s best to create a folder named Drush in the root directory of Denwer and copy it there.
3. We will need the following additional applications:
- LibArchive: http://gnuwin32.sourceforge.net/packages/libarchive.htm
Libarchive is a software library that can create and read several different streaming archive formats, including the most popular tar variants, several CPIO formats, and both BSD and GNU variants.
- GZip: http://gnuwin32.sourceforge.net/packages/gzip.htm
GZip is a compression utility designed for archiving. Its main advantages are better compression and being free of patented compression algorithms.
- WGet: http://gnuwin32.sourceforge.net/packages/wget.htm
GNU Wget is a free utility for downloading files from the World Wide Web using HTTP and FTP protocols.
4. After installation, copy and rename the file C:\Program Files\GnuWin32\bin\bsdtar.exe to C:\Program Files\GnuWin32\bin\tar.exe.
5. Edit the environment variable PATH: Control Panel › System › Advanced system settings › Advanced › Environment Variables › System Variables › Path
Add paths to php.exe, drush.bat, and the tar/get/wget executable files (use semicolon as separator).
Insert the code:
;Z:\usr\local\php5\;Z:\drush\;C:\Program Files\GnuWin32\bin\
6. In the file drush.bat, specify the full path to PHP:
@Z:\usr\local\php5\php.exe "%~dp0drush.php" %*
7. Open the console and type the command drush
or drush --help
:
To open the command prompt in Windows, click Start>Run and type cmd or command into the input field.
In the next article, we will look at how to work with the Drush command set.