How to fix call to undefined function libraries_get_path() in multi-site install? I am setting up a multi-site Drupal 7 install. I have the base site set up correctly and running just fine. When I create the second site (a sub domain of the first site), the install.php script ran fine but when I try to view the site I get the following error:

Fatal error: Call to undefined function libraries_get_path() in /var/www/drupalhome/d7/sites/all/themes/mytheme/template-preprocess.php on line 75


I assume that since the second site inherits everything from the first site (since it is the default install) that the second site should display just fine. However it looks like the second site doesn't know about the libraries module and is throwing the above error (at least that is my interpretation of it). My question is: how can I fix this?

Thanks.
...since the second site inherits everything from the first site..."


To the best of my knowledge that's not how a multi-site setup works; in my experience there's no inheritance involved. Core code/modules/themes/libraries etc can be shared between any number of sites, but each has their own separate database (and files structure, potential for site-specific modules/themes etc.).

When you add a new site you get a fresh Drupal install, none of the settings from any of the other sites in the setup are copied over. 

An inheritance-based workflow wouldn't make sense, as multi-sites can contain any number of completely different Drupal sites - the point is that they can share the resources mentioned above, and when it comes time to upgrade core/contrib modules you only have to do it once for all the sites in the setup.

You can solve the specific problem you're currently having by enabling the libraries module on the new site; but if your custom theme relies on other contrib modules to be installed as well, those will need to be enabled before the site will work properly. Similarly, if the custom theme relies on settings/variables that were available in the default site, those will need to be restored.

I think in your case it would make more sense to clone the default site and database into the new one (bypassing the installation procedure entirely), then make the necessary adjustments to distinguish it from the default site afterwards.

Either that, or wrap the default site's functionality up in Features/Config, perhaps creating an install profile along the way, and use that to instantiate the a clone when you need one.