16

Do you have any idea on what might be causing this error when I execute:

drush si geoslate --db-url='mysql://root:root@localhost/geoslate' --site-name=Geoslate

Command site-install needs a higher bootstrap level to run - you will need to invoke from a more functional Drupal environment to run this command.
The drush command 'si vimn_geoslate' could not be executed.
A Drupal installation directory could not be found

?

18

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.

  • Further to this, you may need to use the -r option to specify the root in some setups. – Alfred Armstrong Apr 11 '13 at 11:59
  • 6
    I know this is an old question and answer, but can you elaborate on why a settings.php file is needed for a drush site-install command, which normally creates this file? – mpdonadio Apr 18 '16 at 23:58
2

For that error: Drush needs a higher bootstrap level to run

Write on your terminal: mysql

if you see something that:

Unknown command 'mysql'

Then the problem comes from mysql, that's why your drush commands don't work.

Install MySql by Brew: https://brew.sh

Brew install mysql
1

When I wanted to install and enable some modules I encountered with this error. by changing the line 'host' => 'localhost' in settings.php file of my site to 'host' => php_sapi_name() == 'cli' ? '127.0.0.1' : 'localhost' now I can install my modules through Drush.

1

I have encountered this issue and I tried the accepted answer, which didn't work for me. As this question turns up high on Google results, I'm offering my solution in the hope that it helps others in my situation.

In my case, the mysql-client package was not installed. apt-get install mysql-client fixed Drush for me.

Why didn't I have the mysql-client package installed on a Drupal development machine? I'm developing on Windows and using WSL for Drush purposes.

-1

Setup an alias for your site in the alias.drushrc.php file. Make sure MySQL executable is in your path variable.

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.