Roots Discourse

Aborted trying to redefine constant ‘MULTISITE’. `define(‘MULTISITE’, …)

Hi all,

Matt’s issue here: Aborted trying to redefine constant 'MULTISITE'. `define('MULTISITE', ...)` has already been occurred elsewhere - was also a problem for me. The replies obviously weren’t very helpful.

The solution for me was to ignore most of this documentation: https://roots.io/trellis/docs/multisite/ – as it appears to be outdated.

So, in other words, don’t add anything to your applications.php file. Also, the /wp/ directory issues seem to be resolved and can be ignored. Defining the “domain_current_site: store1.example.com” in your .yml seems to also not be necessary.

Updating the wordpress_sites.yml with the correct values seemed to be the only thing that actually had to be done now. WITH THE EXCEPTION of me having to still leave “Config::define(‘SUBDOMAIN_INSTALL’, true);” in the applications.php file – in order to actually get my subdomains working (even though I defined them as “true” in wordpress_sites.yml – not sure why I still had to do that, but that did indeed get me up and running).

What Matt mentioned in his post was also happening to me on deploys.

Hope this helps someone.

1 Like

Nevermind on everything I just said. I ran into a few issues with Mulitisite plugins after thinking I was in the clear. The only fix I could find was destroying and vagrant-uping a new box. This time I kept everything from here: https://roots.io/trellis/docs/multisite/ in my application.php file, updated my wordpress_sites.yml file with:

multisite:
enabled: true
subdomains: true

and env:
domain_current_site: domain.com

When doing so, everything works on my local development environment.

However…

Now I’m running into the same issue where, as Matt mentioned, I’m getting an error on an attempted deploy to Production saying: “Aborted trying to redefine constant ‘MULTISITE’. define('MULTISITE', ...) has already been occurred elsewhere.” - but I need these in order for my local development to work and I’d hate to have to comment this out and deploy the application.php file every time I deploy changes.

Any ideas?

I got past this but don’t know why it’s doing this.

My local didn’t work as well with Config::define('MULTISITE', false); So i removed the Config:: part, deployed and didn’t get that error and the local was back up again.

I think there’s a specific step that either has been missed or needs to be done correctly.

Although the above is fixed, I can’t use the sync script to push the DB to production as it’s not “installed” correctly with the db. It’s the redirect loop problem.

Got the db working using this Multisite on remote server = redirect loop || database error

But the sync script shows an error:
Error: Site 'getflode.com/' not found. Verify DOMAIN_CURRENT_SITE matches an existing site or use '--url=<url>' to override.

And after this error i get the redirect loop back :smiley:

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