Drush 8.1.2 is not working on Windows I have installed Drush 8.1.2 on Windows 7, but it doesn't work. Few command are working, but few are not working.


drush uli 1 works
drush dl &lt;project name&gt; works
drush en &lt;project name&gt; doesn't work
drush cc all doesn't work


Running drush en "module name", I get the following: 


  Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command.
  The drush command 'en fieldupdate' could not be executed.
  Drush was not able to start (bootstrap) the Drupal database.
  Hint: This may occur when Drush is trying to:  
  
  
  bootstrap a site that has not been installed or does not have a configured database. In this case you can select another site with a working database setup by specifying the URI to use with the --uri parameter on the command line. See drush topic docs-aliases for details.
  connect the database through a socket. The socket file may be wrong or the php-cli may have no access to it in a jailed shell. See http://drupal.org/node/1428638 for details.
  
  Drush was attempting to connect to:
   Drupal version         :  7.34
   Site URI               :  http://default
   Database driver        :  mysql
   Database hostname      :  localhost
   Database port          :
   Database username      :  root
   Database name          :  staticpages
   PHP configuration      :  C:\xampp\php\php.ini
   PHP OS                 :  WINNT
   Drush script           :  C:\Users\ins237\AppData\Roaming\Composer
                             \vendor\drush\drush\drush
   Drush version          :  8.1.2
   Drush temp directory   :  C:/Users/ins237/AppData/Local/Temp
   Drush configuration    :
   Drush alias files      :
   Drupal root            :  C:\xampp\htdocs\cms-staticpages
   Drupal Settings File   :  sites/default/settings.php
   Site path              :  sites/default
Looks like your database cannot be contaced, run drush status to make sure of that. If that's the issue, then you should update your settings.php files with the correct ip, I guess 127.0.0.1 for your xampp stack.

Not an answer to your question, but running PHP/Drupal on Windows is just asking for problems. You should look into Vagrant or Docker to run your Drupal sites on Windows, that will save you a lot of pain in the long run AND will make it easier to deploy your sites later on.