10

I installed aquia drupal and added a core drupal folder into the sites list.

I also installed the windows installer of drush, it works ok for downloading modules but when I try to enable them I get this screen:

C:\Documents and Settings\Administrator\Desktop\drupal>drush en ctools
Command pm-enable needs a higher bootstrap level to run - you will       [error]

need invoke drush from a more functional Drupal environment to run
this command.
The drush command 'en ctools' could not be executed.                     [error]

Drush was not able to start (bootstrap) the Drupal database.             [error]

Hint: This error often occurs when Drush is trying to bootstrap a
site that has not been installed or does not have a configured
database.

Drush was attempting to connect to :
  Drupal version    : 7.9
  Site URI          : http://default
  Default theme     : garland
  Administration theme: garland
  PHP configuration : C:\Program Files\Propeople\Drush\Php\php.ini
  Drush version     : 5.0-dev
  Drush configuration:
  Drush alias files :
  Drupal root       : C:/Documents and
Settings/Administrator/Desktop/drupal
  Site path         : sites/default
  Modules path      : sites/all/modules
  Themes path       : sites/all/themes
  File directory path: sites/default/files
  %paths            : Array

You can select another site with a working database setup by
specifying the URI to use with the --uri parameter on the command
line or $options['uri'] in your drushrc.php file.

Anyone know how to solve this?

As a side note, whats the easiest way to get drush with the bash working on windows? Any good tuts?

10

This particular error happens when drush cannot find the settings.php file to read in and "bootstrap" itself.

You need to cd into the drupal directory (Document root) of your drupal install in order for it to read in a settings.php file.

Looks like your pwd (present working directory) is on your desktop. Which i'm going to make a quick assumption that that directory isn't where your drupal install is located at.

As a side note, whats the easiest way to get drush with the bash working on windows? Any good tuts?

I highly recommend looking into installing/using Cygwin on windows; as it's a slight improvement.

From there you'll be able to do more things with Drush. The sql-sync and several other functions i hear don't totally work reliably. For even more bonus points you may want to move to a linux or mac environment (something that has a terminal built in).

If you must stay with windows, please consider a drupal project called, quickstart, that creates a virtual machine that allows you to run ubuntu through a remote desktop terminal.

3
  • 1
    You can also set up site alias files w/ the path information to your DOCROOT, which allows you to run drush from anywhere. – mpdonadio Nov 30 '11 at 3:05
  • actually the dir is C:\Documents and Settings\Administrator\Desktop\drupal which is the root folder of the drupal installation. – qwertymk Nov 30 '11 at 3:08
  • @qwertymk so change your directory and run drush from there. – chrisjlee Nov 30 '11 at 21:21
5

If your sites folder is not named default, then cd to the folder that contains settings.php and try again. You can also specify the root and site explicitly with the --root and --uri options. See drush topic for more drush help; in particular, read the example aliases topic.

Be aware that there are still open issues with Drush on Windows. For best result, be sure that you are using the latest installer (23 Nov as of this writing).

1

I had a similar issue but the root cause was a little different. Drush wasn't able to find the php.ini file. An easy way to check if you have the same problem is to run drush status and see if the PHP Configuration value is blank or not.

If it is, the quick and easy way to solve this problem is to specify the PHPRC path variable in Environment Settings and point it to the right php.ini file.

2
1

From my experience, this error strikes, when php invoked by drush is not loading the additional modules, which are used, when php is used inside the web-server (such as pdo and pdo_mysql).

Find, where on your system the files like pdo.ini and pdo_mysql.ini are located. Then set environment variable PHP_INI_SCAN_DIR to point to that directory and try running drush again.

0

you have like me probably forgot to add a docroot/sites/default/settings.local.php

<?php
$databases = array(
    'default' => array(
            'default' => array(
                    'database' => 'database_name',
                    'username' => 'root',
                    'password' => '',
                    'host' => '127.0.0.1',
                    'port' => '',
                    'driver' => 'mysql',
                    'prefix' => '',
            ),
    ),
);
$conf['file_temporary_path'] = '/tmp';
0

Having issue enabling modules using Drush.

OS: Windows 10 | Wamp Server 3.0.6 6 Bit | Apache 2.4.23 | PHP 5.6.25 | Mysql 5.7.14

$ drush status

Drupal version : 8.3.3

Site URI : http://default

Database driver : mysql

Database hostname : 127.0.0.1

Database port : 3306

Database username : root

Database name : d8

PHP configuration : C:\wamp64\bin\php\php5.6.25\php.ini

PHP OS : WINNT

Drush script : C:/Users/{username}/AppData/Roaming/Composer/vendor/dru sh/drush/drush.php

Drush version : 8.1.12

Drush temp directory : C:\Users{username}\AppData\Local\Temp

Drush configuration :

Drush alias files :

Drupal root : C:\wamp64\www\d8

Drupal Settings File : sites/default/settings.php

Site path : sites/default

Sync config path : sites/default/files/config_E6SAOaCUH8rQXxYNzKf6ZlT-u VwHuORJbi1aeT8x1zE4nMxT8FxUGFr36_Cjtq_ACGAGLt4_9g/sy nc

------ Github Bash Output -------

laxman-nb MINGW64 /c/wamp64/www/d8/sites/default

$ drush cr

Command cache-rebuild needs a higher bootstrap level to run - you will need to invoke drush from a more functional [error]

Drupal environment to run this command.

Command cache-rebuild requires Drupal core version 8+ to run.[error]

The drush command 'cr' could not be executed. [error]

------ Github Bash Output -------

Can you help me with this.!

Thank in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.