• Hi,
    i have this strange issue:
    I enabled the multisite and everything was working fine, then i had to revert back to a backup taken just before enabling it (by the plesk panel), and now if i try to enable it again following the same steps, i get the database connection error.
    It’s a subdirectory install, and if i go to mysite.com/wordpress it works fine, but i can’t get rid of the error when on mysite.com.
    Before enabling the multisite the site was up for few months, giving no problems when accessing it from mysite.com.

    The second time i enabled the multisite it skipped the part where asks for the network name and other things, i think the restore of the backup didn’t erased this informations, and god knows what else…

    The exact moment when it brokes it’s when i paste the provided lines in the wp-config.php and .htaccess files and click on “login”.

    suggestions on where to investigate?

    here is my .htaccess (in the root dir):

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) wordpress/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ wordpress/$2 [L]
    RewriteRule . index.php [L]
    </IfModule>
    
    # END WordPress

    wp-config.php(just the relevant part, after the db connection configuration, which is 100% correct):

    define('WP_DEBUG', false);
    
    define('WP_HOME','https://mysite.com/wordpress');
    define('WP_SITEURL','https://mysite.com/');
    
    define( 'WP_ALLOW_MULTISITE', true );
    
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'mysite.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    
    /* That's all, stop editing! Happy blogging. */
    
    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
    
    define ('FS_METHOD', 'direct');
    
    //--- disable auto upgrade
    define( 'AUTOMATIC_UPDATER_DISABLED', true );

    index.php (in the root dir):

    <?php
    /**
     * Front to the WordPress application. This file doesn't do anything, but loads
     * wp-blog-header.php which does and tells WordPress to load the theme.
     *
     * @package WordPress
     */
    
    /**
     * Tells WordPress to load the WordPress theme and output it.
     *
     * @var bool
     */
    define('WP_USE_THEMES', true);
    
    /** Loads the WordPress Environment and Template */
    require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );

    and this are the first lines of functions.php:

    <?php
    update_option('siteurl','https://mysite.com/');
    update_option('home','https://mysite.com/wordpress');
  • The topic ‘"Error establishing a database connection" when enabling multisite’ is closed to new replies.