1
votes

I have started to learn Drupal on this week and I have installed the drush on my virtual machine with CenOS ( Drupal version: 7.28, Drush version: 7.0-dev). I installed drupal using drush by command: drush dl --drupal-project-rename=mysite and downloaded some moduls by command: drush dl admin_menu ctools views ... But when I want enable these moduls in Drupal by command: drush en -y admin_menu_toolbar ... I have errors: Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to[error] run this command. The drush command 'en admin_menu' could not be executed. [error] Drush was not able to start (bootstrap) the Drupal database. [error]

I changed the code in the file /sites/default/settings.php

'host' => 'localhost', to 
'host' => php_sapi_name() == 'cli' ? '127.0.0.1' : 'localhost',

but it still does not work.

Tell me please how can I fix it?

If I use command "drush si standard --db-url=mysql://user:password@localhost/db_name" database is create and drupal install. But when I try to sign in using provided username and password server answer me "404 Not found".

Pictures:

http://gyazo.com/c34c2f361d1675d6df42b909d7eded09 http://gyazo.com/a118b2e370b79103046f21e50f955b2f

2

2 Answers

0
votes

Just running drush dl --drupal-project-rename=mysite will not install drupal for you. Only download the source.

Running drush si standard --db-url=mysql://user:password@localhost/db_name will install it for you.

Alternatively you can add --account-pass=somepassword to set the user 1 pass directly when installing.

Remember to change the --db-url to suit your setup.

After that is done, be sure you stand in the project when you run drush commands.

0
votes

In my case it turned out that I needed to install mysql-client:

apt-get install mysql-client

I had the following situation: drush 4, 5 and 6 worked fine for me. drush 7+ didn't work (different errors, including that ones you're describing). And my MySQL database was located on a separate server.

HTH, Alexander