6

I installed Drush, but most of the commands doesn't work, I guess. I tried drush cc all and got the following output:

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

drush status outputs the following:

PHP configuration : /etc/php5/cli/php.ini
Drush version : 4.5
Drush configuration :
Drush alias files :

12

You need to rebuild cache with Drupal 8, rather than clear it:

drush cr all
  • Got the same . The drush command 'cr all' could not be found. – Crazyrubixfan Apr 28 '16 at 8:42
  • Sounds like you're not running inside a Drupal website. The above is sound though, there's no drush cc for Drupal 8 – Clive Apr 28 '16 at 8:44
  • yes am running from /var/www-drupal , and its giving output for drush status – Crazyrubixfan Apr 28 '16 at 8:45
  • but status is not listing fully i guess : PHP configuration : /etc/php5/cli/php.ini Drush version : 4.5 Drush configuration : Drush alias files : – Crazyrubixfan Apr 28 '16 at 8:48
  • 2
    try " drush cr " instead of using drush cr all :) – Leopathu Apr 28 '16 at 10:57
4
2

You can even try:

  • drupal 7 :drush cache-clear all
  • drupal 8 : drush cache-rebuild

Refer two articles you can have some more idea on clearing and rebuilding cache:

  1. http://www.metaltoad.com/blog/drupal-8-first-impressions-back-end-developer

  2. https://www.drupal.org/documentation/clearing-rebuilding-cache

0

Shouldn't you be using Drush 8.* for Drupal 8? I believe your version is just outdated. (And you need drush cr as Clive pointed out.)

0

If your drush status does not say anything about the database then it is not connecting to the database and thinks your site is effectively dead. This is very VERY common for new sites. Possible fixes:

  1. Make sure your in the same directory that the index.php file is in for drupal.

or if in multisite setup then.

  1. Make sure you are in the $rootdir/sites/yoursitename/ subdirectory when you execute "drush st".

or

  1. Make sure you supply the --uri="myawesomesite.local" to tell drush which settings.php file to try to find and use.

  2. Make sure you can load your site in your browser first.

See sample screenshotenter image description here

0

This happens to me on ever single D7 installation and I solve it by changing the host setting for the DB in my settings.php file from "localhost" to "127.0.0.1enter image description here"

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.