Command cache-clear needs a higher bootstrap level to run

I created a new VMWare appliance for the project that I am working on. I deployed the project and created the DB and all that and when I was trying to access the site, it told me the site was offline. I decided to install DRUSH and clear the cache and see if I can find more information about this problem.

Once I installed drush, I got this error:

[roychri@p1695vm drupal]$ drush cc
Command cache-clear needs a higher bootstrap level to run - you will need invoke drush from a more functional[error]
Drupal environment to run this command.
The drush command 'cc' 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    : 6.20
  Site URI          : http://default
  Database driver   : mysql
  Database hostname : localhost
  Database username : root
  Database name     : drupalbd
  Default theme     : garland
  Administration theme: garland
  PHP configuration : /etc/php.ini
  Drush version     : 4.5
  Drush configuration:
  Drush alias files :
  Drupal root       : /home/roychri/www/drupal
  Site path         : sites/default
  Modules path      : sites/all/modules
  Themes path       : sites/all/themes
  %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.

However, when I was using drush sql-cli it was working just fine!

So the clear-cache was telling me it could not connect to the DB but sql-cli was able to connect just fine.

I was able to find the real reason by enabling the debug in drush like this:

[roychri@p1695vm drupal]$ drush -d cc
Bootstrap to phase 0. [0.02 sec, 1.31 MB]                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.02 sec, 1.44 MB] [bootstrap]
Bootstrap to phase 6. [0.05 sec, 3.36 MB]                                                                    [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.05 sec, 3.36 MB]                                   [bootstrap]
Initialized Drupal 6.20 root directory at ./ [0.06 sec, 3.87 MB]                                                [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.06 sec, 3.87 MB]                                   [bootstrap]
Initialized Drupal site default at sites/default [0.06 sec, 3.87 MB]                                            [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.07 sec, 3.87 MB]                          [bootstrap]
mysql extension for PHP is not installed. Check your php.ini to see how you can enable it. [0.07 sec, 3.9 MB][bootstrap]
Bootstrap to phase 5. [0.07 sec, 3.9 MB]                                                                     [bootstrap]
Bootstrap to phase 6. [0.08 sec, 3.9 MB]                                                                     [bootstrap]
Command cache-clear needs a higher bootstrap level to run - you will need invoke drush from a more functional[error]
Drupal environment to run this command. [0.08 sec, 3.9 MB]
The drush command 'cc' could not be executed. [0.08 sec, 3.9 MB]                                             [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.

After reading the debug information I ended up realizing the answer was right there.

mysql extension for PHP is not installed.

Doh!

I installed php-mysql and voila!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • You may post PHP code. You should include <?php ?> tags.
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options