WPMS database error on install

August 2, 2013 2.2k views
I've run several WPMS installs in the past, but never run into this. Environment: - DO LAMP install - Set up virtual host via https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts for domain.com So files are in /var/www/domain.com/public_html and WordPress install goes swimmingly. check the vanilla install and can update plugins, upload media, etc. Turn on WPMS using: define('WP_ALLOW_MULTISITE', true); Jump back in and the Tools > Network Setup is there. Recommended config defines are: define('MULTISITE', true); define('SUBDOMAIN_INSTALL', false); define('DOMAIN_CURRENT_SITE', 'domain.com'); define('PATH_CURRENT_SITE', '/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1); and the .htaccess recommendations are also standard. Plug those in... and run bang into "Error establishing a database connection" So something strange is happening between the standard and the WPMS install: probably something to do with the path because of the virtual host setup. I notice that these instructions are only for running in the root (with IP address as DOMAIN_CURRENT_SITE) but I've run WPMS in similar virtual host environments before without issues. https://www.digitalocean.com/community/articles/how-to-set-up-multiple-wordpress-sites-using-multisite Help appreciated!
3 Answers
Add these in:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', true);
define('SAVEQUERIES', true);

Reload the wordpress site, do you see any errors?
I have a hunch that the way you're structuring your directories what's causing you problems... lemme look into it some more.
Here's some info. from the WordPress Codex:

Apache Virtual Hosts and Mod Rewrite

To [allow] mod_rewrite to work within an Apache Virtual host [make sure you enable it, first; and] you may need to set some options on the DocumentRoot.

<VirtualHost *:80>
 DocumentRoot /var/www/vhosts/wordpress
 <Directory /var/www/vhosts/wordpress>
  AllowOverride Fileinfo Options

In some instances, you will need to add All to your AllowOverride for all .htaccess rules to be honored.
Have another answer? Share your knowledge.