Hi everyone,
I set up a simple D6 site with a handful of contrib modules and drush to keep things updated. I ssh'd onto the server a couple days ago because I got an email about upgrades being available and tried to "drush status", but got an html page printed to Terminal about how my site was in offline mode. This was odd, because the site was perfectly accessible in my browser.
So I upgraded to the latest green release of drush (4.0-rc5) and tried again. This time I got status working:
[~/public_html]# drush status
Drupal version : 6.19
Site URI : http://default
Database driver : mysql
Database hostname : localhost
Database username : [redacted]
Database name : [redacted]
Default theme : garland
Administration theme : garland
PHP configuration : /usr/local/lib/php.ini
Drush version : 4.0-rc5
Drush configuration :
Drush alias files :
Drupal root : /home/[user]/public_html
Site path : sites/default
I knew that there were updates available, so I tried to run "drush sup", but got this:
[~/public_html]# drush sup
Command site-upgrade needs a higher bootstrap level to run - you will need invoke drush from a more functional Drupal environment to run this command. [error]
Command site-upgrade needs the following modules installed/enabled to run: update. [error]
The drush command 'sup' 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.
My site is working fine in the browser (it's not offline, it's full functional, etc) and the "update status" module is enabled, so I don't know what else this wants. Running this command from inside the "[drupal]/sites/default" folder results in the same error.
I can do simple drush commands that don't require bootstrapping (such as "dl"), but anything requiring the database results in this error (for example, "en"). What's going on, and how do I fix it? I'm experiencing this on several different sites on several different servers.
Thanks,
Dave
Comments
Have you found out what it
Have you found out what it was? I'm having the same problem...
My solution was changing the
My solution was changing the db_url in settings.php to another server (not localhost).
I'm also having this issue
I'm also having this issue.
solution
I got it to work by running the drush command from th drupal/modules folder.
drush dl "module name" downloads and expands your module in the directory you run the command from. Then when you try to enable it, it's in the incorrect location.
Numerous potential reasons
Hi,
There are a couple of different things that may cause this problem.
First, try to change "mysqli" to "mysql" in connection chain in settings.php, then put the IP of the server, and not its name (works in D7 as well).
Cheers
D7
I had the error in D7. Had to change localhost to 127.0.0.1 and add port 8889 in settings.php. I'm using MAMP
Drush alias was wrong in my case
I've solved the problem in my case. The Drush alias was wrong:
alias drush='php -c /home/scito/etc/drush/drush.ini /home/scito/drush/drush.php'Correct:
alias drush='php -c /home/scito/drush/drush.ini /home/scito/drush/drush.php --php="php -c /home/scito/drush/drush.ini"'The correct alias is described in the Drush README.txt.
Use drush.ini to override the restrictive php.ini settings
I know that this thread is old but it is very high in the search engine results for "drush cannot bootstrap" and this applies to all versions of Drush and Drupal.
You can do this in your ~/.drush/drush.ini Just uncomment the line:
;disable_functions =by removing the semicolon.
Clear the Drush cache with:
drush cc allthen run
drush stIf you see your drush.ini file listed in the section PHP configuration then you should be good to go, otherwise set the environmental variable DRUSH_INI to the path to your drush.ini file
DRUSH_INI=/home/username/.drush/drush.iniYou can set the environmental variable in your shell configuration file to have it always present. For the Bash shell you could place the following into
~/.bashrcexport DRUSH_INI=/home/username/.drush/drush.iniThe other way is to include it before the drush command an alias to Drush. Again for the Bash shell in ~/.bashrc
alias drush='DRUSH_INI=/home/username/.drush/drush.ini $HOME/.composer/drush7/vendor/drush/drush/drush'Clear Drush's cache again and then check the status to ensure that Drush now sees your php.ini overrides in drush.ini
For more information on this from Drush itself run:
drush docs-ini-files
If you do not have a drush.ini you can create one by running:
drush docs-ini-files > ~/.drush/drush.ini