I've recently upgraded to Drush 8, from Drush 6.2 (That was installed using pear).

Drush on cPanel runs fine as root, but when I try to run it as a regular user in a valid Drupal directory I get the error:

Command pm-refresh needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run[error]

this command

Or for just trying to clear cache using drush cc all:

No Drupal site found, only 'drush' cache was cleared

And when I add --debug to the end of a command I get a mysql error with drush:

Access denied for user 'username'@'localhost'
  • 1
    Does the user you're executing as have permission to read the site's settings.php?
    – Clive
    Nov 27, 2015 at 22:02
  • This error usually means that you are trying to run drush from a directory that isn't part of a drupal site.
    – Eyal
    Nov 28, 2015 at 1:30
  • To avoid having to run Drush from within a Drupal docroot, think about using Drush aliases: drupal.org/node/1401522
    – anavarre
    Nov 28, 2015 at 8:32

1 Answer 1


I was able to get to the bottom of this problem. When I ran drush in debug mode, for example "drush status --debug" it outputted an error that it could not connect to the database.

After hours of digging for some reason on this particular cPanel server there were .my.cnf files in each user's home directory which contained mysql authentication details. Drush was taking precedence on these credentials and in turn not able to connect to the particular Drupal install's database. I simply did "rm -rf /home/username/.my.cnf to delete each of these hidden files, then running drush works!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.