Unable to Activate LS Cache on one Site

#1
We have three WordPress sites on our WHM server, all in their own cPanel accounts.

We are running LiteSpeed 5.1.9 and LiteSpeed Cache 1.0.11.

When we activate Litespeed Cache on two of the accounts, it works flawlessly (as far as we can tell).
The third account is a WordPress multisite which has not been launched yet, we were hoping to activate the Cache and perform Production server testing before switching the DNS records next week.

Unfortunately when we visit Manage Cache Installations and click the Enable button next to this particular WordPress installation, it fails with the following error:
Code:
/home/(SITENAME)/public_html - Unknown error encountered - No Action Taken.
So far I have tried:
  • Changing the /etc/hosts file on the server to trick it into thinking the site was live
  • Editing any custom additions to our wp-config.php file
  • Removing any custom or unusual files from the public_html folder (we have a few subdirectories for third party integrations)
  • Replacing the .htaccess file with a WordPress default version
  • Removing the .htaccess file entirely
Unfortunately the above error message is completely unhelpful ("Unknown Error encountered") and I have no idea how to troubleshoot this. There's nothing I can see in the documentation, Wiki, or forums which might explain what could be causing this error.

EDIT: IT WORKS!
While I was writing this forum post it started working (typical...). I ended up commenting out the Multisite setup from the wp-config.php file:
Code:
/* Multisite */
/*define('WP_ALLOW_MULTISITE', true );
define('ADMIN_COOKIE_PATH', '/');
define('COOKIE_DOMAIN', '');
define('COOKIEPATH', '/');
define('SITECOOKIEPATH', '/');
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', $domain_current_site);
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);*/
Note that we use a variable to define the DOMAIN_CURRENT_SITE, but I wouldn't think this would cause the problem.

I can see that activating Litespeed Cache modifies the wp-config.php file, so perhaps the activation failed because it couldn't find a line of code somewhere? Not sure.

I will keep investigating, hopefully everything is working now and this post helps someone else facing similar issues in the future. Would love some additional info from the LiteSpeed team, perhaps they can make the "Unknown Error" message a little more useful in a future version.

Thanks

EDIT: Additional Information
It now looks like the following line in the wp-config.php file is causing the "Unknown Error" message:
Code:
define('SUBDOMAIN_INSTALL', true);
Removing this changes the error to "Error establishing a database connection".
 
Last edited:

Michael A

Administrator
Staff member
#2
Hi Chris,

At a glance I think that your issue is probably caused by the variable defined 'DOMAIN_CURRENT_SITE'. When preparing to load the WordPress environment on enable, we do a manual check on wp-config.php and look for 'define(MULTISITE, true);'.

If we find this, one of the things we do is grab the settings from 'DOMAIN_CURRENT_SITE' and 'PATH_CURRENT_SITE' and set two needed server variables before loading the WordPress environment with wp-load.php .

If these variables are not set for multisite, WordPress will eventually call wp_die() and kill the php process. This would lead to the "Unknown Error" message you were encountering.

I'm not too sure what un-setting 'SUBDOMAIN_INSTALL' did, but likely it either caused the database connection to fail before wp_die() could be called or it somehow bypassed the multisite check on WordPresses end.

Try re-defining 'SUBDOMAIN_INSTALL' and setting 'DOMAIN_CURRENT_SITE' directly and let me know if it still runs into problems.

Regards,
-Michael
 
Top