Issue
When I run a drush command it gives me an error with the message "needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command".
An example of the full message is:
Command updatedb-status needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command. [error]
The drush command 'updatedb:status' could not be executed. [error]
Resolution
There are a number of ways that can be used to resolve this:
1. Run the command under the docroot
directory of the application.
Normally drush
assumes that the directory that you are running the command from is at the root directory or a sub directory below of your application. By running the drush
command under the docroot
, drush
will run the command correctly.
An example of this is running the drush updatedb:status
command:
example@staging-2924:/var/www/html/example.dev/docroot$ drush updatedb:status
[success] No database updates required.
2. Use the --root
option for drush.
You can pass the --root
or -r
parameter to drush
to tell it which docroot
you want to run the command against.
An example of this is running the drush updatedb:status
command:
example@staging-2924:~$ drush --root=/var/www/html/example.dev/docroot updatedb:status
[success] No database updates required.
example@staging-2924:~$ drush -r /var/www/html/example.dev/docroot updatedb:status
[success] No database updates required.
3. Use the drush
alias
You can use the alias for the drush
command which will have the docroot
details configured. You can even use the --root
option as part of the alias to be sure.
An example of this is running the drush updatedb:status
command:
example@staging-2924:~$ drush @example.dev updatedb:status
[success] No database updates required.
example@staging-2924:~$ drush @example.dev --root=/var/www/html/example.dev/docroot updatedb:status
[success] No database updates required.