I'm trying to set up two sites in EE with MSM & Master Config. But I'm failing. Feels like I'm really close but can't get over the last hurdle.
I've used this suggested method but it's not quite there.
Here are how the domains are set up (simplified):
/home/
/site1
/html
/assets
/third-party
/add-ons
/themes
/tpl
/config
/system
/themes
/admin.php
/index.php
/site2
/html
/admin.php
/index.php
Site1 is working fine as far as I can tell. No issues in the CP and the home page shows up fine (just has static HTML at the moment).
Site2 is another story:
- I don't yet have templates set up for Site2 so the home page is just showing blank (expected)
- Going to
site2.dev/admin.php
shows the login page but it is unstyled, which tells me it's not finding the themes folder correctly. (Same if I log in.) - If I'm logged into the CP via site1 and attempt to switch to site2, I get this error:
Fatal error: Call to undefined method Cp::switch_site() in /path/to/home/site1/html/system/expressionengine/controllers/cp/sites.php on line 57
Update: This issue was due to having MSM be newer & not compatible with the EE version I had. Upgraded EE and no more error.
I've tried suggestion's from Jason Varga's article on this to no avail (particularly the section from "Not so fast" on, though I've tried the whole thing and that went worse).
And here's what I have in the Dynamic path settings section inside config.master.php
:
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
$base_url = $protocol . $_SERVER['HTTP_HOST'];
$base_path = FLC_DOCROOT;
$system_folder = APPPATH . '../';
$images_folder = 'assets/img-ee';
$images_path = $base_path . '/' . $images_folder;
$images_url = $base_url . '/' . $images_folder;
$env_config['index_page'] = '';
$env_config['site_index'] = '';
$env_config['base_url'] = $base_url . '/';
$env_config['site_url'] = $env_config['base_url'];
$env_config['cp_url'] = $env_config['base_url'] . 'admin.php';
$env_config['theme_folder_path'] = $base_path . '/themes/';
$env_config['theme_folder_url'] = $base_url . '/themes/';
$env_config['emoticon_path'] = $images_url . '/smileys/';
$env_config['emoticon_url'] = $images_url . '/smileys/';
$env_config['captcha_path'] = $images_path . '/captchas/';
$env_config['captcha_url'] = $images_url . '/captchas/';
$env_config['avatar_path'] = $images_path . '/avatars/';
$env_config['avatar_url'] = $images_url . '/avatars/';
$env_config['photo_path'] = $images_path . '/member_photos/';
$env_config['photo_url'] = $images_url . '/member_photos/';
$env_config['sig_img_path'] = $images_path . '/signature_attachments/';
$env_config['sig_img_url'] = $images_url . '/signature_attachments/';
$env_config['prv_msg_upload_path'] = $images_path . '/pm_attachments/';
$env_config['third_party_path'] = $base_path . '/assets/third-party/addons/';
$env_config['url_third_themes'] = $base_url . '/assets/third-party/themes/';
$env_config['path_third_themes'] = $base_path . '/assets/third-party/themes/';
Lastly, as far as add-ons go, most of third-party ones seem to work, but I haven't tested all of them.
So, my hunch is that something needs to change in regard to the 3rd party paths to get them to work properly and to get themes to work properly. Just not sure what. And I've no idea how to get the site switch function working in the CP to seamlessly switch from site1 to site2 and vice versa.
Any thoughts / suggestions?