Roots Discourse

Aborted trying to redefine constant 'MULTISITE'. `define('MULTISITE', ...)` has already been occurred elsewhere

I’m trying to deploy a multisite to a newly provisioned staging server. I followed the instructions on this page and was able to successfully get the multisite working on my local dev, and I was able to provision the staging server successfully but now when trying to deploy, it fails at this task:

TASK [deploy : WordPress Installed?] ***********************************************************************************
System info:
  Ansible 2.4.0.0; Darwin
  Trellis 1.0.2: March 13th, 2019
---------------------------------------------------
non-zero return code
PHP Fatal error:  Uncaught
Roots\WPConfig\Exceptions\ConstantAlreadyDefinedException: Aborted trying to
redefine constant 'MULTISITE'. `define('MULTISITE', ...)` has already been
occurred elsewhere. in
/srv/www/domain.com/releases/20190416164250/vendor/roots/wp-
config/src/Config.php:106
Stack trace:
#0 /srv/www/domain.com/releases/20190416164250/vendor/roots/wp-
config/src/Config.php(26): Roots\WPConfig\Config::defined('MULTISITE')
#1 /srv/www/domain.com/releases/20190416164250/config/application.php(57):
Roots\WPConfig\Config::define('MULTISITE', true)
#2 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1150) :
eval()'d code(7): require_once('/srv/www/cashbe...')
#3 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1150):
eval()
#4 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1111):
WP_CLI\Runner->load_wordpress()
#5 phar:///usr/bin/wp/vendor/wp-cli/wp-
cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start()
#6 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.ph in
/srv/www/domain.com/releases/20190416164250/vendor/roots/wp-
config/src/Config.php on line 106
fatal: [staging.ip]: FAILED! => {"changed": false, "cmd": ["wp", "core", "is-installed", "--skip-plugins", "--skip-themes", "--require=/srv/www/domain.com/shared/tmp_multisite_constants.php"], "delta": "0:00:00.110107", "end": "2019-04-16 16:43:13.736862", "failed": true, "failed_when_result": true, "rc": 255, "start": "2019-04-16 16:43:13.626755", "stderr_lines": ["PHP Fatal error:  Uncaught Roots\\WPConfig\\Exceptions\\ConstantAlreadyDefinedException: Aborted trying to redefine constant 'MULTISITE'. `define('MULTISITE', ...)` has already been occurred elsewhere. in /srv/www/domain.com/releases/20190416164250/vendor/roots/wp-config/src/Config.php:106", "Stack trace:", "#0 /srv/www/domain.com/releases/20190416164250/vendor/roots/wp-config/src/Config.php(26): Roots\\WPConfig\\Config::defined('MULTISITE')", "#1 /srv/www/domain.com/releases/20190416164250/config/application.php(57): Roots\\WPConfig\\Config::define('MULTISITE', true)", "#2 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1150) : eval()'d code(7): require_once('/srv/www/cashbe...')", "#3 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1150): eval()", "#4 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1111): WP_CLI\\Runner->load_wordpress()", "#5 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\\Runner->start()", "#6 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.ph in /srv/www/domain.com/releases/20190416164250/vendor/roots/wp-config/src/Config.php on line 106"], "stdout": "", "stdout_lines": []}
	to retry, use: --limit @/Users/me/Sites/domain.co/trellis/deploy.retry

There are two cases of define('MULTISITE', ...) that I found: the Config::define('MULTISITE', true); line that I put in site/config/application.php, and I also found a define('MULTISITE', false); in trellis/roles/deploy/files/tmp_multisite_constants.php.

Can someone help me figure out what I’m doing wrong?? I NEED to have the Config::define('MULTISITE', true); line in application.php don’t I?

1 Like

Maybe follow the directions.

nice formatting!:+1::+1::+1:

have you tried setting it on FIRE?

1 Like

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