Did you ever think about DRUPAL's faster development environment? I did not think for first two years as a DRUPAL developer. Its may be lack of guidance. I faced lots of VIVA about DRUPAL from different firm, they even don't ask me about development environment. One day i realize i am taking too much time about administrating DRUPAL. So search Google and found DRUSH. DRUSH is really really a great tools for fast development. It has huge benefits.
What is DRUSH ?
Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.
Benefits of DRUSH
Suppose you want to install a contributed module "token". What you have to do is ?
- Go drupal.org web site
- Search for token module
- Download it
- Unzip it
- Copy and paste to DRUPAL's module directory
- Open your sites in browser and logged in as admin
- Visit module list page
- Search for token module and select it
- Finally hit save button to enable it
Using DRUSH All these task are done in just 2 commands
- Open your command prompt and go to DRUPAL modules folder (sits/all/modules/contrib). Command: cd wamp\www\d6test\sites\all\modules
- To download token module; command: drush dl token
- Now enable token module; command: drush en token
Just think, you need to install 5/10 modules ! So, its time to switching DRUSH.
In this tutorial, i will show you step by step procedure of how to setup DRUSH in windows
DRUSH installation steps:
- Download & Install WAMP
- Change default MySQL ini (my.ini) file
- Enable some apache module
- Configure php.ini file, save it and Restart all service
- Download DRUSH 6.x ( For PHP 5.3.x and mySQL 5.1.x
- Download and install some necessary library file to run DRUSH
- Change default tar library file
- Add some environment variable to run DRUSH
- Finally, open your command prompt and run DRUSH
Download and install WAMP
Change default MySQL ini (my.ini) file
Go to: mysql directory. In my case: D:\wamp\bin\mysql\mysql5.5.24 (Because i installed WAMP in D Drive). Open my.ini file in nodepad++/notepad. Line 3 says :
This is for a system with little memory (32M - 64M) where MySQL plays ...
Close my.ini and open my-huge.ini in notepad++. Line 3 says:
This is for a large system with memory of 1G-2G where the system runs mainly.
We need bigger memory . So rename my.ini as my_.ini . Copy my-huge.ini and paste here. Rename this file as my.ini . Lets go to next step
Enable some php & apache module
- Enable php module if not already enable: php_mysqli, php_gd2
- Enable apache module if not already enable: rewrite_module, alias_module
Configure php.ini file, save it and Restart all service
Open php.ini file from WAMP system tray and edit some configuration value like
- Change max_execution_time = 180
- Change upload_max_filesize = 128M
- Change memory_limit = 512M
Now save php.ini file and restart your WAMP
Now unzip your zip file and paste it to D: Drive where WAMP directory exists. I put DRUSH directory to my D: drive
Download and install some necessary library files to run DRUSH
Since DRUSH is written mostly for LINUX, we need some utility to run DRUSH for windows.
Go to http://gnuwin32.sourceforge.net page.
Click Packages link Under download sections from left side bar and download the following 4 packages.
Change default tar library file
Assume all packages are installed in C:\Program Files\GnuWin32 directory.
After installed all packages, go to GnuWin32 bin directory C:\Program Files\GnuWin32\bin . Rename tar.exe as _tar.exe.
Now copy bsdtar.exe and paste here. Now rename this file as tar.exe.
Add some environment variable to run DRUSH
- Go to my computer properties (right click on my computer, then click properties)
- click advanced system settings
- click Environment variables button
- Select path on system variables section and click edit
Now add the following environment variables here:
- C:\Program Files\GnuWin32\bin (GnuWin32 bin directory)
- D:\wamp\bin\php\php5.3.13 (PHP installation directory)
- D:\wamp\bin\mysql\mysql5.5.24 (MySQL installation directory)
- D:\drush (DRUSH directory)
Each variable must be seperated by semicolon. So our custom variable looks like:
Click ok to all dialog box.
Finally, open your command prompt and run DRUSH
Now open your command prompt and just write drush. If you see drush related help, then successfully installed DRUSH in your computer.