1

I have been running drush successfully for more than a year. Now running some drush commands such as "drush pml" or "drush up" I suddenly get the well known error:

Command pm-list 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 'pml' could not be executed. Drush was not able to start (bootstrap) the Drupal database.

Usually one gets this error when running drush command in a directory higher than to site's root directory. But in my case I am indeed inside de site's root directory and I still get the error. Besides I also have an .aliases.drushrc.php file which has been working all along and that drush actually takes into account drush st gives:

  Drupal version    : 7.23
  Site URI          : http://default
  Database driver   : mysql
  Database hostname : localhost
  Database username : mydatabase_dru1
  Database name     : mydatabase_dru1
  Default theme     : garland
  Administration theme: garland
  PHP configuration : /Users/me/.drush/php.ini /Users/me/.drush/php.ini
  Drush version     : 5.8
  Drush configuration:
  Drush alias files : /Users/me/.drush/mysite.aliases.drushrc.php
  Drupal root       : /Applications/XAMPP/xamppfiles/htdocs/kl-local
  Site path         : sites/default
  Modules path      : sites/all/modules
  Themes path       : sites/all/themes
  File directory path: sites/default/files
  %paths            : Array

The problem is also not due to running in a jailed shell because invoking mysql in a shell returns:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 736

Server version: 5.1.44 Source distribution

Also invoking drush sql-cli in a shell returns:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 735

Server version: 5.1.44 Source distribution

Also drush rsync and drush sql-sync do work! I can get my remote site synced to my local one.

One error I have noticed is that locally drush st returns the wrong theme names. it returns:

Default theme : garland
Administration theme : garland

instead of

Default theme : bootstrap_subtheme
Administration theme : seven

Also when I ssh to my remote rsynced sql-synced site then the version of drush installed on that remote site works normally.

Even odder, when I run my local drush version on both my local site and my remote (synced) site, drush works on the remote but not locally. for instance from my local machine:

drush @mysite.local up returns:

bash-3.2$ drush @mysite.local up drush @mysite.local up Command pm-update needs a higher bootstrap level to run - you will need invoke drush from a more functional Drupal environment to run this command. [error] Command pm-update needs the following modules installed/enabled to run: update. [error] The drush command 'up' 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.23   Site
 URI               : http://default   Database driver   : mysql   Database
 hostname          : localhost   
 Database username : mydatabase_dru1   
 Database name     : mydatabase_dru1   
 Default theme     : garland  
 Administration theme: garland   
  PHP configuration : /Users/me/.drush/php.ini /Users/me/.drush/php.ini   
 Drush  version     : 5.3   
 Drush configuration:   
 Drush alias files : /Users/me/.drush/mysite.aliases.drushrc.php   
 Drupal root       : /Applications/XAMPP/xamppfiles/htdocs/mysite-local
 Site path         : sites/default
 Modules path      : sites/all/modules   
 Themes path       : sites/all/themes   
 File directory path: sites/default/files   %paths


 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.

But drush @mysite.remote up (for my remote synced site) actually starts the update process.

I get the same behaviors whether I run drush 5.3 or drush 5.8 on os x10.8.5

One thing I am wondering is if the line:

PHP configuration : /Users/me/.drush/php.ini /Users/me/.drush/php.ini

does not indicate a problem somehow.

Also I have php 5.3.27 (cli) installed on my local system and XAMMP (which is serving my site) is using its own version 5.3.1 could that introduce some conflicts?

My remote server runs php 5.2.21

Any idea where the problem could be originated from?

  • Can the shell user read the site's settings.php file? – Clive Nov 17 '13 at 23:39
  • yes. head default/settings.php returns the first lines of settings.php. The file can also be opened with emacs. – Baba Nov 18 '13 at 1:05
  • also using a different version of drush does not fix the problem. – Baba Nov 18 '13 at 1:55
  • Please don't use code blocks for non-code content :) Fixed it for you. – Mołot Nov 18 '13 at 9:46
  • Have you tried drush cc drush ? – Beebee Nov 21 '13 at 16:35
2

The problem was due to a PHP conflict. Drush was using the OS X installed PHP instead of the XAMPP one. Adding the following line in my .profile fixed the problem.

export DRUSH_PHP='/Applications/XAMPP/xamppfiles/bin/php'
0

Ran into the same problem here. I use MAMP on Mac OS X Mavericks. I used this path in my .profile file

export DRUSH_PHP='/Applications/MAMP/bin/php/php5.5.10/bin/php'

For those who don't know where the .profile is located, it's at /Users/yourname/ (run ls -a to see hidden files).

  • This is not the answer. Use comments. – mixerowsky Oct 1 '15 at 17:40

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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