Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7
-
Fix Version/s: 4.7.5
-
Component/s: WordPress Integration
-
Labels:
-
Documentation Required?:None
-
Funding Source:Contributed Code
Description
When running WordPress in multi-network mode (multiple multisites in a single WP install) where CiviCRM is installed on a multisite instance that is not the primary multisite instance, Civi's external scripts that use civicrm.config.php (e.g. extern/ipn.php) cannot find civicrm.settings.php.
There are two situations in which this occurs:
- When the multi-network install was created prior to WP 3.5
- When the multi-network install was created after WP 3.5
When multi-network install pre-dates WP 3.5, WPMU (as it was called) have a ‘wp-content/blogs.dir’ directory where sub-sites and non-primary multisite instances store their uploads. Many of these instances will have retained this scheme since upgrading it is difficult. In these cases, civicrm.settings.php will be found in '/wp-content/blogs.dir/[BLOG_ID]/files/civicrm/'.
When multi-network install was created using WP 3.5 or newer, all uploads for sub-sites (or further multisite instances) are found in ‘/wp-content/uploads/sites/[BLOG_ID]’. The civicrm.settings.php file will therefore be found in '/wp-content/uploads/sites/[BLOG_ID]/civicrm/'
The immediate (but somewhat hacky) solution is to add two search paths to Bootstrap::findCivicrmSettingsPhp():
$cmsRoot . '/*/blogs.dir/*/files/civicrm'
and
$cmsRoot . '/*/uploads/sites/*/civicrm'
. I say "hacky" because this find procedure will trigger warnings when `open_basedir` is in effect.