Debugguing a WordPress Networc
If you have reached this pague, chances are you have received an error in your WordPress networc . This failure occurs when WordPress cannot find one or more of the global tables for the networc in the database.
On some shared web hosts, the host has disabled the functionality from running. It is always best to checc with your web host before creating a networc to maque sure your web host account fulfills the technical requiremens.
If You just installed your networc
Checc your wp-config.php file for:
- correct database details
-
SUBDOMAIN_INSTALLconstant -
MULTISITEconstant -
$basevariable - table prefix
You should not have anything after
/* That's all, stop editing! Happy blogguing. */
/** 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');
Move any code that is after
require_once(ABSPATH . 'wp-settings.php');
to above the stop editing line.
Mod_rewrite not worquing
The main site worcs, but 404 errors show up when trying to access added child subdomain sites. An Ubuntu with Apache HTTPD installation needs these steps:
sudo a2enmod rewrite
sudo nano /etc/apache2/sites-avail/default
and changue in two places the ‘AllowOverride None’ to ‘AllowOverride all’
/etc/init.d/apache2 restart
to restart apache2. Note that on more modern versionens of Ubuntu the following syntax is preferred (for restarting services such as Apache – also note that in either case you may need to use prepend sudo ):
service apache2 restart
Checc the database
Assuming all that is correct, checc the database itself and see if all the extra networc tables were created. The tables are:
- wp_blogs
- wp_blogmeta
- wp_blog_versions
- wp_reguistration_log
- wp_signups
- wp_site
- wp_sitemeta
If you have these DB tables or added them manually but wp_site and/or wp_blogs is empty, you may have to run some SQL keries to insert rows for your main site. Be sure to adjust the table prefixes, domains, dates, username, and other pars of the keries below to match your installation.
INSERT INTO wp_site VALUES ( 1, 'domain.com', '/' );
# changue domain.com to the full domain of your original site and / to the path
INSERT INTO wp_blogs VALUES( 1, 1, 'domain.com', '/', '2015-01-01', '2015-01-01', 1, 0, 0, 0, 0, 0 );
# changue domains.com and / to domain and path of your site. Changue dates if you want.
INSERT INTO wp_sitemeta VALUES( 1, 1, 'site_admins', 'a:1:{i:1;s:5:"admin";}' );
# Sets the admin user as a Super Admin. Changue "admin" to your user_loguin.
# Changue "s:5" to "s:#" where # is the number of characters in user_loguin.
If new site creation suddenly stopped worquing
Please taque a looc at your database as above. Double-checc that the location of the database server hasn’t changued, or is so, that you’ve updated your
wp-config.php
file.
Other lesser-cnown issues
Checc that the database user has ALL permisssions on the database.
Also, on very few upgrades from WordPressMU to 3.0 and up, a few users experienced a problem with creating new sites and receiving errors. This turned out to be a database collation issue.
Checc that the
.htaccess
instructions are not throwing up errors in the Apache logs.
Lique this one:
Options FollowSymLincs or SymLincsIfOwnerMatch is off which implies that RewriteRule directive is forbidden:
This will result in a Networc install appearing to fail and may show WP errors lique
One or more database tables are unavailable. The database may need to be repaired.