Drush won't run at the command line in any Drupal 8 subdomain installation:
[warning] Drush command terminated abnormally.
I am using GreenGeeks hosting for several Drupal 8.8.7 sites, one 8.8.6 site, one 9.0.0 site as subdomains, e.g. subdomain.domain.com and each subdomain is configured to point to the /web subdirectory (by installation default).
- I installed Drush using this guide: https://www.greengeeks.com/support/article/how-do-i-install-drush/
- I used composer successfully to install all above sites, by following the same guide and supplementing with version specific installation instructions, e.g.
composer create-project drupal/recommended-project:8.8.7 bingo
- I updated my
.bashrcfile, by using the same guide, i.e.
# User specific aliases and functions alias drush='~/drush/vendor/bin/drush'
The D8 websites work fine. HOWEVER, if I navigate to the command line of any of the 8.x drupal sites, then Drush will not run as example below:
acctname@svrname [~/public_html/bingo]# drush version [warning] Drush command terminated abnormally. acctname@svrname [~/public_html/bingo]#
Drush runs NORMALLY at the /public_html directory, but there is no drupal installed there:
acctname@svrname [~/public_html]# drush version Drush version : 10.2.2 acctname@svrname [~/public_html]#
Drush ALSO RUNS NORMALLY at the Drupal9 website:
acctname@svrname [~/public_html/drupal9]# drush version Drush version : 10.2.2 acctname@svrname [~/public_html/drupal9]#
THE FOLLOWING INFO MAY NOT BE RELATED...
HOWEVER, at the risk of distraction, the errorlog indicates a drush-related error for the D9 website and the website suddenly shows this error (it used to work):
The website encountered an unexpected error. Please try again later.
And the error_log reports this:
Error: Class 'Drush\Log\DrushLog' not found in /home/projects/public_html/drupal9/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 257
...but Drush still runs normally