Invalid argument - wp-content/db.php on line 263 oops

I am having trouble getting the combination of Multi Database, Multi Domain and Domain Mapping working successfully on a new installation.

I am using the latest version of Wordpress (3.1.2) using subfolders for multisite and the the latest version of a number of MUDEV plugins with a RocketTheme theme Panacea (network enabled) using the Gantry Framework (enabled on a per site basis only)

The other (non MUDEV) extensions are Tiny MCE Advanved, XCloner, Gravity Forms and the Rok plugins used by the Panacea theme

So far I have done the following:

1. Created 16 databases plus the global database using CPanel. The global database is nicely populated with all the plugins installed since.
2. Installed and Multi Domain and Domain Mapping. Overwritten sunrise.php using dm-sunrise.php and added the line define( 'SUNRISE', 'on'); to wp-config.php
3. Entered the dedicated IP address for the main site in Network Admin Settings
4. Added a domain to Multi Domain (Public) and added a * A record pointing to the dedicated IP address of the main site
5. Tried unsuccessfully to add a new site using - I got sent to and a 404 page on save.
6. Successfully added a new site
7. Went to the list of sites and got the error Warning: Invalid argument supplied for foreach() in /home/main/public_html/wp-content/db.php on line 263
oops against the ste

Supporter plugin is installed and activated but not configured.
Supporters only is set to No
The domain used for the administration area should be the [that entered by user]

In wp-content/db-config.php the folowing are in the global tables section

//---Global Tables--------------------------------------------------------//
//	Do not include default global tables
//	Leave off base prefix (eg: wp_)
//	Usage: add_global_table(TABLE_NAME)
//	EX: add_global_table('something');


What I am trying unsuccessfully to do is:

Use the main site - let's call it with dedicated IP address.

I have several other domains - let's call them; etc hosted on a completely different reseller account.

I want people to be able to visit;; etc and see on those domains content which is being controlled/run entirely from and which will let me create blogs on both and;; etc for paying users.

I would also like blog users to be able to have their blog link through to a domain of their own - for example or and still be accessible through my site

I have root access to the dedicated server hosting the main domain and full WHM/CPanel control over the others. I own all the domain names in question so should be able to configure them correctly if someone can explain why the error ocurred and give me an idiot-proof guide to configuring things that way.

  • Specialist
    • Design Lord, Child of Thor

    In wp-content/mu-plugins/domain-mapping.php I have uncommented line 30

    // UnComment out the line below to allow multiple domain mappings per blog
    define('DOMAINMAPPING_ALLOWMULTI', 'yes');

    I am not using the default wp_ prefix but move-blogs.php seemed to work ok with the non-default prefix

    The main site is in the root of the domain, not a sub-folder.

    These are the settings in wp-config.php

    define('WP_DEBUG', false);
    define('WP_ALLOW_MULTISITE', true);
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', '' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    define( 'SUNRISE', 'on');
    /* That's all, stop editing! Happy blogging. */

    The contents of .htaccess are:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    RewriteRule ^(.*/)?sitemap.xml wp-content/sitemap.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).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

    The site I added to the MultiDomain list has only a cgi-bin folder and an index.html file, no .htacess or other content.

  • Specialist
    • Design Lord, Child of Thor

    I also cannot delete the site showing the error from within wp-admin network admin. It shows on a red background and the name changes to /name/ - deleted. I can delete it directly from the blogs table in the global database if I go to phpMyAdmin.

    Also wondering if the A record becomes active straight away or takes time to propogate like nameserver changes do...

  • DavidM
    • DEV MAN’s Mascot

    Hi Specialist,

    Thanks for providing all this detail. It will definitely help to find out what's going on. That said, from what you've mentioned here, the following especially caught my eye.

    The site I added to the MultiDomain list has only a cgi-bin folder and an index.html file, no .htacess or other content.

    This particular site should be pointing to your main site, correct? If so, it shouldn't have a folder at all. Could you clarify what you mean by this?

  • Specialist
    • Design Lord, Child of Thor

    In that case I have misunderstood the plugins requirements.

    All the sites are currently hosted on my reseller account, so, have their own CPanel.

    Do I have to delete the hosting accounts and go instead to where I manage the domains themselves? The place where I can change the nameservers if I want to move the sites to other hosting?

    I can also park domains on the main domain which is running the multisite setup, or create the other domains as add-on domains. Which works best?

  • DavidM
    • DEV MAN’s Mascot

    Hi Specialist,

    If you'd like to use those domains as multi-domain options from your site, then yes, you wouldn't need them to be setup with their own CPanel. And yes, you could simply remove the hosting accounts and manage them where you'd manage the domains.

    If your primary domain is, I imagine you could simply park these (assuming your primary domain is and that should point them as they need to be. From there you could add them as multi-domains in your settings on site and manage them from there.

    If your primary domain isn't, you could simply setup those other domains as addon domains, specifying the directory where your site is installed.

  • Specialist
    • Design Lord, Child of Thor

    Thanks David,

    I'll delete the accounts and park them up on the main domain and try again.

    I'll also try the AddOn domain process and see how I get on with that.

    It's good to know what the rules and any limitations are from the outset.

    I'll test out some remotely hosted subfolders too and report back.

    Many thanks for your help.

  • Specialist
    • Design Lord, Child of Thor

    Here's how I got on.

    I took one of the domains I want to use and changed the nameservers so instead of pointing to the account where I had set up CPanel hosting for it, it was using the same ns1 and ns2 nameservers as the main domain.

    That allowed me to successfully park it on the main domain, I was also able to add a * wildcard in using CPanels Advanced DMX Zone Manager.

    Not only does the domain, let's call it, redirect to the main domain, but I also get redirected there when I try to add a site to it or a sub-folder in Network Admin.

    Also, when I try to add a new site as a subfolder to the main site instead, I still get that same original error message that is pointing to the foreach() argument on /public_html/wp-content/db.php on line 263

    That suggests to me that perhaps I probably need to look at Multi-DB because by checking the Root dedicated server account I see the ownership of the main domain is the reseller account I set the main server up on. The only other possible owner is Root.

    It may be that the dedicated IP alone is not enough for the dedicated server setup.

    I'm going to try the same thing with another Multistite that isn't using Multi-DB, is hosted on the same server, and also has a dedicated IP address.

  • Specialist
    • Design Lord, Child of Thor

    Looks like the Invalid argument - wp-content/db.php on line 263 oops is down to Multi-DB versus the dedicated server setup or my faulty setup of Multi-DB.

    I was able to create a site on the 2nd test site main domain where MultiDB was not installed without the error, as long as it was on the main domain.

    However, I still get thrown back to the main domain when trying to set up a new site on either the root of the added domain in MultiSite or a subfolder. The site does not get added to the main domain sites list.

    It may be that even though CPanel allows me to add an A * wildcard Record, there is still a delay in the DNS switching.

    That means there may still be an ownership issue if there is no change after 48 hours - which is the max I've ever known nameserver changes to take to propogate, so am guessing that could be true for any other DNS issues.

  • Specialist
    • Design Lord, Child of Thor

    I managed to get MultiDatabase working by manually creating the 16 databases plus Global in CPanel and Global populated just fine.

    Then I came up against another issue that was resolved in another thread on Multi-Domains

    When I say resolved, it answered my question that I although I could use the main site, for example to create and, I was not able to then have or so had to look elsewhere for answers.

    I tried the Wordpress User Synchronisation but the one way synchronisation did not allow me to manage the chain beyond one master and many slaves.

    The Domain Mapping plugin worked fine.

    I've just installed Networks for Wordpress and it worked out of the box when it came to creating the first domain on the network.

    Next stage is to see whether I can create the individual sites under etc from and/or etc plus checking out which plugins play nicely with that set-up.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.