Trouble setting up Multisite on localhost

Hi, I haven’t had to spool up a multisite in a while and I’m having trouble getting it setup.

I’ve followed the documentation outlined here:

Before provisioning I’ve added the Multisite configuration to application.php, then I provisioned.

After provisioning I used ‘vagrant ssh’ and ran

$ wp core multisite-install --title="site title" --admin_user="username" --admin_password="password" --admin_email="you@example.com"

from here:

vagrant@trellis:/srv/www/project.com/current

Then I receive the following message:

Single site database tables already present.
The network already exists.

When I attempt to login to the admin, I’m unable to.

wp user list returns the correct user login and role as administrator.

When I run wp super-admin list it states:

Error: This is not a multisite installation.

I’ve attempted to destroy the instance and retry this setup twice with no luck.

Additionally, the self-assigned SSL isn’t being setup properly and the site is not secure.

Here’s my dev group_var file:

wordpress_sites:
  project.com:
    site_hosts:
      - canonical: trellis.project.build
    local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root)
    admin_email: info@project.com
    multisite:
      enabled: true
      subdomains: false
    ssl:
      enabled: true
      provider: self-signed
    cache:
      enabled: false

Here’s what I put in my application.php file:

/* Multisite */
Config::define('WP_ALLOW_MULTISITE', true);
Config::define('MULTISITE', true);
Config::define('SUBDOMAIN_INSTALL', false); // Set to true if using subdomains
Config::define('DOMAIN_CURRENT_SITE', env('DOMAIN_CURRENT_SITE'));
Config::define('PATH_CURRENT_SITE', env('PATH_CURRENT_SITE') ?: '/');
Config::define('SITE_ID_CURRENT_SITE', env('SITE_ID_CURRENT_SITE') ?: 1);
Config::define('BLOG_ID_CURRENT_SITE', env('BLOG_ID_CURRENT_SITE') ?: 1);

Hey there,

I was just in the same process of setting up a multisite-install with Trellis & Bedrock and faced some issues myself – not sure if they are related to your case but nonetheless:

  • No need for wp core multisite-install in your local env, thus the message can be disregarded
  • The /* Multisite */ configs in config/application.php must come before Config::apply() – this was the fault in my case :roll_eyes:

Did you manage in the end?
Regards!

P.S.: I’ve added a PR to clarify the docs regarding this…

This topic was automatically closed after 42 days. New replies are no longer allowed.