Closed (won't fix)
Project:
Drush
Version:
8.x-6.x-dev
Component:
Core Commands
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Sep 2011 at 18:20 UTC
Updated:
11 Sep 2013 at 05:05 UTC
My set-up:
- wimleers.com (my own site) on localhost
- on filesystem at /htdocs/wimleers.com
- through web server available at http://dev/wimleers.com
- sites.php file with the following contents:
$sites['dev'] = 'wimleers.com';
$sites['localhost'] = 'wimleers.com';
(Using dev.wimleers.com instead of dev doesn't help. This is a very strange syntax, by the way.)
- *no* sites/default directory, only a sites/wimleers.com directory (and of course sites/all)
Drush error message:
--( /htdocs/wimleers.com/sites )-- drush cc
Command cache-clear needs a higher bootstrap level to run - you will need invoke drush from a more functional Drupal [error]
environment to run this command.
The drush command 'cc' could not be executed. [error]
Could not find a Drupal settings.php file at ./sites/default/settings.php.
Possibly related to #443576: drush_site_path() unaware of sites.php on D7 and/or #399474: drush fails when using a domain with sites.php.
Comments
Comment #1
moshe weitzman commentedwhat is the name of the subdir under sites that holds settings.php? is it wimleers.com?
could you add another line to sites.php like
$sites['default'] = 'wimleers.com';Comment #2
wim leersCorrect.
That worked. However, uncommenting the line again doesn't allow me to reproduce the problem above. While it used to be perfectly reproducible, even when starting a new terminal session. Does drush cache things? If not, I don't know how to explain this.
Also: I guess I misinterpreted how to fill the
$sitesarray insites.php? It isn't based on the actual domain name in use; rather, it's based on the directory name inside the Drupalsitesdirectory, and maps that to another directory. That makes sense. So I can actually just replace the contents listed in my first post with what you told me to try, and it'll have the same effect (in my set-up, at least).(This also explains why
localhost.exampleis used forlocalhost/example.)Feeling stupid.
Comment #3
wim leersOkay, no, I interpreted it correctly.
Just this:
results in
http://dev/wimleers.comshowing me the Drupal installation page — meaning that it didn't loadsites/wimleers.com. I really do needBut then it makes even less sense that adding the line you suggested fixed things. Or maybe it just somehow fixes things for Drush. After all, drush doesn't know from which domain name a request is being made, and thus which
sites/%site%/settings.phpto load. Right? Hence thedefault. Drush probably does some caching, then, which would explain my inability to reproduce the problem.Comment #4
greg.1.anderson commenteddrush cc drushclears the drush command cache. Didn't check to see if that was related to your issue above, though.Comment #5
greg.1.anderson commentedThis issue was marked
closed (won't fix)because Drush has moved to Github.If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to
closed (duplicate).Please ask support questions on Drupal Answers.