Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-18099

CiviCRM 4.7.n cannot find civicrm.settings.php in WordPress Multi Network

    Details

    • 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:

      1. When the multi-network install was created prior to WP 3.5
      2. 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.

        Attachments

          Activity

            People

            • Assignee:
              haystack Christian Wach
              Reporter:
              haystack Christian Wach
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: