2

I have a Drupal install on a CentOS development server. Running drush from outside my web directory returns as you'd expect (a list of Drush commands).

Running drush from inside my web directory returns nothing at all. Running with debug returns this:

Using the Drush script found at /home/***/vendor/drush/drush/drush using pcntl_exec
[preflight] Config paths: /home/***/vendor/drush/drush/drush.yml
[preflight] Alias paths: /home/***/drush/sites,/home/coventry/drush/sites
[preflight] Commandfile search paths: /home/***/vendor/drush/drush/src

When using Drush from outside my web directory with --root, I get this:

drush uli --root=~/***.com
We could not find an applicable site for that command.

My settings.php file exists in that above directory/sites/default, and the database connection info works. The site is accessible in the browser.

Any ideas on this botched Drush install?

2
  • Maybe --root doesn't like ~. Maybe try an absolute path.
    – leymannx
    Aug 6, 2019 at 4:57
  • 1
    make sure Drush knows where mysql is. I ran into this the other day after updating XAMPP, and I need to add mysql back to my PATH (WIndows 10 machine). Drush can complete some commands without mysql, so it's not always immediately obvious this is missing. Aug 6, 2019 at 16:06

2 Answers 2

2

I had this error and for me I solved it by using a version of drush that is compatible with the version of Drupal that the site is using.

In my scenario I was getting that error when using drush 10 with a Drupal 7 site.

When I used Drush 8 with that same Drupal 7 site, I could then run usual drush commands, without getting that error.

2
  • 2
    Yes, the support matrix is listed on the Drush website.
    – Kevin
    Sep 16, 2021 at 14:30
  • +1 upvote Indeed! And my answer was in case this is what might help the OP as it did in my scenario. And others, who arrived here, like me when Google-ing this error! Sep 16, 2021 at 14:52
1

In addition to above, make sure you are running the uli command from the docroot of your project, I had lando setup and I got same error because I was running the command outside the docroot.

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.