WordPress.org

Ready to get started?Download WordPress

Forums

Multisite setup issues (4 posts)

  1. markpea
    Member
    Posted 2 years ago #

    Even after 3 or more successful install of wordpress in multisite mode I still cannot get my head around the process or why it's so finicky. Basically, I have ssh and sudo access to my server so I do everything on the command line (no faffing with cpanel and the like).
    I create the mysql database in the normal way with
    mysql> CREATE DATABASE testbp DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
    and add the database user. I then install the latest 3.2.1 code into the appropriate dir usr/local/www/apache22/data/test-bp and reconfigure the Apache VHOST to point to here. Now I start up the WP site and create an administrator account with password. Now I log out.

    Next I want to convert this to a multisite (folders) setup, so to wp-config.php I add:

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'quake.sergius.earlham.edu' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    And also I configure the appropriate .htaccess.
    As far as I can see I have done things in a perfectly logical way and yet when I open up the URL I get:

    Error establishing database connection

    Editing the wp-config.php and changing define( 'MULTISITE', true ); to false allows me to login.

    So I'm in a catch-22 situation here. I need a multisite setup and yet the system won't allow me to create one. What is going on here and why is this procedure so tricky?

  2. markpea
    Member
    Posted 2 years ago #

    So I drop the database tables and switch define('WP_DEBUG', true); to define('WP_DEBUG', false);. Now the URL loads and I setup the site again with admin user and password.

    But I still need to convert to multisite so I fire up vim wp_config.php and in the section:

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'blogs.sergius.earlham.edu' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    I change 'MULTISITE', false to 'MULTISITE', true. Save and exit.
    A single click to reload gives me

    Error establishing database connection
    Could not find site blogs.sergius.earlham.edu. Searched for table wp_blogs in database testbp. Is that right?
    
    What do I do now? Read the bug report page. Some of the guidelines there may help you figure out what went wrong. If you’re still stuck with this message, then check that your database contains the following tables:
        wp_users
        wp_usermeta
        wp_blogs
        wp_signups
        wp_site
        wp_sitemeta
        wp_registration_log
        wp_blog_versions

    And, yes, none of the tables wp_blogs
    wp_signups
    wp_site
    wp_sitemeta
    wp_registration_log
    wp_blog_versions
    exist because the system has not created them yet. This is definitely catch-22.

  3. Next I want to convert this to a multisite (folders) setup, so to wp-config.php I add:

    No you added teh wrong thing.

    Read http://codex.wordpress.org/Create_A_Network

    You ONLY add define('WP_ALLOW_MULTISITE', true);

    Then you add the rest as it tells you to add it, after a refresh. Yes it matters or we wouldn't have split it up :)

  4. markpea
    Member
    Posted 2 years ago #

    What really puzzles me is the point at which the multisite database tables get created. When I first login as an admin I have to do this in single site mode, right? Then, at what point do the multisite tables get created? It's all really arcane. Why doesn't the install script pick up MULTISITE = true and no database tables yet and then go ahead and create them? The current process -- which I cannot figure out -- just doesn't make sense to me. Perhaps someone can explain it. The 5 steps outlined in http://codex.wordpress.org/Create_A_Network make no mention of the current state of being logged in. Since I can never get my system to step 4 I'm in a Catch-22.
    To recap:

    1. Create single user site. In this process you have set up the admin account.
    2. Login as admin
    3. add define( 'MULTISITE', true); to wp-config.php while still logged in as admin
    4. Go to profile or try to refresh page. Get error No site defined on this host. If you are the owner of this site, please check Debugging a WordPress Network for help.
    5. Go back to mysql and drop tables. Start again at 1.

Topic Closed

This topic has been closed to new replies.

About this Topic