If you are testing something new, there is always chance to break things, that’s why you should always have a fail-safe system. Thing is sometime situation could be a bit different. I decide to test “WP-Rocket”, so disabled W3 Total Cache. I will write a separate article about my experience with “WP-Rocket”. Soon, when I decide to revert back to W3 Total Cache, I started to get weird errors, here I will explain how I solved it.
I am all in for speed & optimization. I had to test “WP-Rocket” on a live site as I wanted to do real world performance test, not some Load I/O test! But that did not worked out, even after their support proactively tried to help. So, I tried to disable “WP-Rocket”, and reactivate W3 Total Cache, then I started to this error below.
Notice: get_settings is deprecated since version 2.1! Use get_option() instead. in ~/wp-includes/functions.php on line
WordPress database error: [DROP command denied to user ‘remote_user’ for table ‘w3tc_cdn_queue’]
DROP TABLE IF EXISTS
WordPress database error: [CREATE command denied to user ‘remote_user’ for table ‘w3tc_cdn_queue’]
CREATE TABLE IF NOT EXISTS
id int(11) unsigned NOT NULL AUTO_INCREMENT,
local_path varchar(500) NOT NULL DEFAULT ”,
remote_path varchar(500) NOT NULL DEFAULT ”,
command tinyint(1) unsigned NOT NULL DEFAULT ‘0’ COMMENT ‘1 – Upload, 2 – Delete, 3 – Purge’,
last_error varchar(150) NOT NULL DEFAULT ”,
date datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’, PRIMARY KEY (
date) ) DEFAULT CHARACTER SET utf8;
I posted about this in WordPress.org support, did not got any answer though. Later on I find the solution myself.
Before coming to solution, let me describe few things
# Error message: At the beginning I was not getting any error message at all, just the message that “plugin could be activated because of fatal error”. So I had to enable all error notification for awhile. I used this code in wp-config.php
define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG_LOG’, true );
define( ‘WP_DEBUG_DISPLAY’, true );
@ini_set( ‘display_errors’, 0 );
Now you have all the error message of the world. Don’t keep this code of production site. Keep it like this
define( ‘WP_DEBUG’, false );
But make sure you know what you are doing. Disabling the debug message entirely is not a good idea.
So, I find out the issue is with DB permission. W3TC needs to create new table “w3tc_cdn_queue” to store cdn query information. But as this WordPress installation I am talking about is pretty large, its Database is stored in a remote server, and as a security measure I restricted it to some limited permission, that WordPress basically need to run for everyday. So, I just had to log into remote db server and assign a temporary permission with this command
GRANT DROP,CREATE ON dbname.* TO ‘dbuser‘@’host‘;
*revoke this permission as soon as the installation are done.
Restart the mysql
sudo service mysql restart
Then I tried running the installed again, and it worked just fine.
few things you should keep in mind. If you have issue with re-installing W3TC, it could be for far simple reason too. Check those steps first
1) Check if your cache folder is clean “wp-content/cache”.
2) Delete the dropin “object-cache.php” it could conflict with the one comes with W3TC.
3) Try removing all W3TC related files fro server including the config file & folder (make sure you have a backup of your working W3TC configuration. You should have one backup with your working configuration from the W3TC option page.
4) Temporary give 777 permission to “wp-content” folder, its very risky so make sure you revert back as soon as you are done.
Let me know in comments if you have this same issue or something related, and don’t forget to post at the WordPress.org support forum.