What is the purpose of sites.php and how does it relate to settings.php?

I have done a lot of web searches and looked at the comments in these files, but cannot find a simple explanation.

  • 1
    Did you read the text inside example.sites.php?
    – donquixote
    Commented Aug 9, 2015 at 14:17
  • And the keyword to look for in google is "Drupal multisite" or "multi-site".
    – donquixote
    Commented Aug 9, 2015 at 14:19
  • Most of the time the sites.php is not needed.
    – donquixote
    Commented Aug 9, 2015 at 14:20
  • I'm confused after reading the api link. It's as if sites.php is used only on Sundays when it rains otherwise it's used along with settings.php on Mondays only. It all seems like gibberish. The thing that prompted this question was when I somehow totally messed up my dev site. The solution (drupal.stackexchange.com/questions/169294/…) referred to settings.php and sites.php. What I'm getting so far is that these two files have to do with multi-sites only? Commented Aug 9, 2015 at 21:35

1 Answer 1


Looking at conf_path() should help clarify the relationship here. conf_path() builds the default subdirectory (inside the sites directory) Drupal will goto for settings.php (and other site-specific configurations). It's default search behavior can be overridden with sites.php.

Your Answer

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

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