By Rajesh Vishwakarma

2016-06-19 14:45:09 8 Comments

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 <project name> works
  • drush en <project name> 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 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
    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


@David 2017-03-05 18:37:41

You should take a look at the **Drupal Console project.*

Drupal Console is abstracted on top of Symfony and such an abstraction provides better cross-platform compatibility.

In this post you can find example commands to completely setup a Drupal installation from console on Windows (without Linux bash, real Command line or Powershell scripts):

The sample commands there include:

  • Setting up a code base from scratch using Composer
  • Installing the website from the command line using "drupal install" command.
  • Enabling/downloading modules using composer and the "drupal module:install" command.
  • Running drupal tests from the console

Not an answer to your question, but running PHP/Drupal on Windows is just asking for problems.

It depends on your budget.

If you are doing brochureware/low budget, you are better off not even setting up an environment at all and looking a, Acquia, Pantheon, etc.

Indeed, Wordress is a much better product for such scenarios (low budget/quickies).

@Karel 2016-07-16 20:55:52

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 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.

@Rajesh Vishwakarma 2016-07-18 10:05:45

Database connection is okay, if so this will not run on my machine.

@rovr138 2017-03-05 19:30:45

"drush uli 1 works" This needs database connection to work.

Related Questions

Sponsored Content

1 Answered Questions

The database is not bootstrapped in another docker container

  • 2018-09-13 14:55:45
  • aib-dit
  • 366 View
  • 1 Score
  • 1 Answer
  • Tags:   drush

3 Answered Questions

[SOLVED] "drush up" fails with "pm-updatestatus failed."

  • 2016-08-20 23:34:41
  • George Blackburn
  • 1221 View
  • 1 Score
  • 3 Answer
  • Tags:   drush updating

1 Answered Questions

[SOLVED] Beginner Drush question. Can't get Drush to do anything!

  • 2015-04-24 21:28:19
  • Subcitizen
  • 822 View
  • 2 Score
  • 1 Answer
  • Tags:   drush

2 Answered Questions

[SOLVED] Drush php-script | Drupal functions such as node_load() are not being found

  • 2014-06-28 07:51:17
  • Francisco Luz
  • 1177 View
  • 1 Score
  • 2 Answer
  • Tags:   drush

3 Answered Questions

[SOLVED] Drush enable module | not working | Drupal 7 on WAMP with PostgreSQL

  • 2014-03-02 17:20:53
  • Cmweb
  • 3256 View
  • 1 Score
  • 3 Answer
  • Tags:   drush database

1 Answered Questions

2 Answered Questions

Error in executing drush command

  • 2013-12-25 08:00:06
  • Harshil
  • 208 View
  • 0 Score
  • 2 Answer
  • Tags:   7 drush

1 Answered Questions

Drush cannot connect to mysql

  • 2015-03-04 12:38:47
  • weristsam
  • 776 View
  • 0 Score
  • 1 Answer
  • Tags:   drush

Sponsored Content