Should third-party modules be installed in the directory sites/all/modules or sites/default/modules? I've seen both recommended by different authors, but they never explain the differences between the two.

Is there an advantage of one over the other for contributed modules?

Comments

zeta ζ’s picture

  • sites/all/modules is for modules that are available to all sites
  • sites/default is for settings.php which will be over-ridden – by the same file name in specific sites directories.

___________________
It’s in the detaιls…

vm’s picture

sites/default/modules would be for modules you only want available to the default site of a multisite

sites/all/modules would be for modules you want available to all sites in a multisite

for a single site, it doesn't make any difference so long as they are kept separate from your core modules

zeta ζ’s picture

I didn’t realise you could do that. I thought a module would have to be over-ridden by another module of the same name – wrong.

Apparently sites/default/modules/module (indeed any thing below sites/default) is ‘over-ridden’ by the presence of a more specific site directory like sites/example.com.

http://drupal.org/node/176046
___________________
It’s in the detaιls…

wintervanilla’s picture

I've inherited a site that was set up with the modules sites/default/modules folder. I want to move them to a sites/all/modules folder in order to mirror the other sites I have. If I just move them, the site breaks - do I need to reinstall modules or do something special to tell drupal where the modules (and I want to move the themes folder too) are?

Cheers!
Andrew

vm’s picture

disable the modules one at at time and move them. Once moved reenable them.

deshilachado’s picture

thanks, this thread was very helpful

smmtss’s picture

What do you mean with the term multisite. Could you give me an example?

vm’s picture

a multisite installation is more then one install running off the same code base, using different databases or the same database with subsequent installs using table prefixes.

qt11’s picture

I just put everything in with the default modules.....

/modules/

is this wrong ??

If so why ?

vm’s picture

It's not that it is wrong. However, now when you update or upgrade your drupal install you have to handpick throug the modules in the to remove the core modules. If you had used sites/all/modules you could have avoided this step and simply deleted the core modules folder.

Thus is it merely a method to make it easuer to update/upgrade.

coloryan’s picture

Maybe it's just me, but I started moving modules over to the sites/all/modules folder and the speed of my site increased substancially.