I installed Drush and then I installed Drupal using the regular installer/method.
When I type drush cc all
on my terminal I get this message:
No Drupal site found, only 'drush' cache was cleared.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityNo, you do not need to install Drupal using Drush in order to use Drush. All you need is to make sure that while running drush cc all
, you are in the Drupal directory.
For example, if your Drupal lies under /var/www/Projects
with root name as drupal
then first you need to move inside /var/www/Projects/drupal
and then run the drush cc all
command.
The reason being, Drush can be executed inside a Drupal environment only.
No, drush is independent of each drupal install. But you need to run the command from within the project root, or using a drush alias.
To test if drush is picking up your site properly, you can run
drush st
This will output information about your site, or will let you know if you are not within a site.
If you are connected, you should see database information like this:
Database username : root
Database name : mydatebasename
Drupal bootstrap : Successful
Then your cache clear will work with
drush cc all
If you run
drush st
from outside of a drupal project, it will not show the database information.