1

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

AlexM
  • 317
  • 2
  • 5

2 Answers2

0

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.

BratAnon
  • 188
  • 3
  • 11
  • Thank you for answer. I tried to do what you suggested. But I have new problem. Used command "drush si standard --db-url=mysql://user:password@localhost/db_name" Drupal was installed and database was created. But when I tried to sign in using provided username and password after installing by drush server answered me "The requested URL /h/mysite/index.php was not found on this server." But if I install drupal using web-interface - these errors are not appear. I don't understand the difference. – AlexM May 29 '14 at 12:55
  • `drush si ....` command does not set up your server environment for you, just the Drupal instance and database. You may still need to set up the site in apache or IIS and your hosts file after Drush is done. – zkent Jun 04 '15 at 02:21
0

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