I have found that the subdomain module breaks drush and have filed an issue with the subdomain module at http://drupal.org/node/1558444.
I would like to troubleshoot the problem with subdomain, but am not sure where to start. I am also having trouble getting php and/or drush to log or display any errors beyond what is available via --debug. Curiously, when I do a drush php-eval with a syntax error in the php it is properly logged to both the screen and syslog, but when I have subdomain enabled and try using drush nothing is logged to syslog and this is all that I get on screen:
ben@rockland:~/web/core$ drush --php=/usr/local/phpfarm/inst/php-5.3.8/bin/php --debug pm-list
Bootstrap to phase 0. [0.01 sec, 4.79 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.03 sec, 5.08 MB] [bootstrap]
Cache HIT cid: 6.0-dev-commandfiles-0-a6c6d0dd059e9d802581732d753eca0a [0.04 sec, 5.09 MB] [debug]
Bootstrap to phase 0. [0.14 sec, 11.04 MB] [bootstrap]
Bootstrap to phase 6. [0.2 sec, 11.05 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.2 sec, 11.05 MB] [bootstrap]
Initialized Drupal 7.12 root directory at /home/ben/web/core [0.26 sec, 15.05 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.26 sec, 15.06 MB] [bootstrap]
Initialized Drupal site default at sites/default [0.27 sec, 15.07 MB] [notice]
Cache HIT cid: 6.0-dev-commandfiles-2-c32acd775c18a90c5b41d0fc9accf5ab [0.28 sec, 15.07 MB] [debug]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.28 sec, 15.07 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.3 sec, 15.09 MB] [bootstrap]
Successfully connected to the Drupal database. [0.3 sec, 15.09 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.32 sec, 16.06 MB] [bootstrap]
Drush command terminated abnormally due to an unrecoverable error. [0.93 sec, 63.67 MB] [error]
I would appreciate any pointers on how to improve the error reporting and also on how to troubleshoot the problem with the subdomain module and drush.
Other than the conflict with drush the subdomain module appears to be functioning properly.
Comments
Comment #1
greg.1.anderson commentedHave you tried setting the site URI with Drush's --uri option? When you use your Drupal site from a Web Browser,
$_SERVER['HTTP_HOST']is set up to hold the URI that was used to access the site. The subdomain module no doubt uses this information to do its magic.In your example above, you are using the cwd to select your site. Since Drush has no idea what the URI should be, it sets
$_SERVER['HTTP_HOST']to "default". This is probably what is confusing the subdomain module. If you add--uri='http://somedomain.com', then Drush will pass that information along via$_SERVER['HTTP_HOST']. Things might work better.You can achieve a similar effect by specifying 'root' and 'uri' in a site alias.
Comment #2
beanjammin commentedDoh, that did it. Thank-you!