Steps to debug:
#1 How to find the possible cause of Drush errors?
In my case I was working with Drupal 7 and Drush 4. When I was working on few commands like download, enable/disable modules..etc it was working fine. Then I tried command like Site install it ended up with errors, likeWD PHP execution error: database name is required and with status error on it WD PHP execution error: database username field is required and with status error on itSo after searching with Google I found the error has occurred due to mismatch in the combination between Drush and Drupal. Now you have found the possible cause of the error, let's see how to resolve this error ,
#2 How to check Drush version?
You can check version of Drush by moving into your Drupal application directory , Let's see each command with example. Drush status alias st : which is used to check the information about the Drush and Drupal as shown below, the command is pretty simple and powerfuldrush status
When you execute the above command you will see the output like below,
#3 How to choose Drush and Drupal ?
You have to choose Drush Tool specific to Drupal version. There are few versions available in Drush let's see the workable combinations.- Drush 4 will work in Drupal 5
- Drush 5 works with both Drupal 6 and 7
- Drush 6 will work with Drupal 6,7 and 8
#4 How to install or upgrade Drush version in Linux?
Upgrading Drush in Linux is pretty simple you can do it with 2 to 3 steps, Once you logged in with your Putty command line, do the followingsudo wget --quiet -O - http://ftp.drupal.org/files/projects/drush-7.x-5.1.tar.gz sudo tar -zxf - -C /usr/local/share sudo ln -s /usr/local/share/drush/drush /usr/local/bin/drush sudo drush
Note you can use the same command to install or upgrade Drush version. Once you upgrade the Drush, navigate to your Drupal application directory and check the Drush status, you will see the version of Drush as 5.1Hope this article will help someone, feel free to post your comment :)
The post How to install and upgrade Drush version in Linux ? appeared first on Mydons.