Support Home > WP Super Cache > WP Super Cache Advanced Troubleshooting Checklist

WP Super Cache Advanced Troubleshooting Checklist

If you have trouble after activating WP Super Cache, check the following checklists and possible problems/scenarios to find a solution.

General settings for WP Super Cache

  1. Is wp-content/ writable by the web server?
  2. Try the Settings -> WP Super Cache page again and enable cache.
  3. The plugin does not work very well when PHP’s safe mode is active. This must be disabled by your administrator.
  4. Make sure cache/wp_cache_mutex.lock is writable by the web server if using coarse file locking.
  5. The cache folder cannot be put on an NFS or Samba or NAS share. It has to be on a local disk. File locking and deleting expired files will not work correctly unless the cache folder is on the local machine.
  6. After uninstalling, your permalinks may break if you remove the WordPress mod_rewrite rules too. Regenerate those rules by visiting the Settings -> Permalink page and saving that form again.
  7. If your browser asks you to save the file after installing Super Cache, you must disable Super Cache compression. Go to the Settings -> WP Super Cache page and disable it there.
  8. If certain characters do not appear correctly on your website, your server may not be configured correctly. You need to tell visitors what character set is used. Go to Settings -> Reading and copy the ‘Encoding for pages and feeds’ value. Edit the .htaccess file with all your Supercache and WordPress rewrite rules and add this at the top, replacing CHARSET with the copied value. (for example, ‘UTF-8’)
AddDefaultCharset CHARSET
  1. Your front page is okay, but posts and pages give a 404. Go to Settings -> Permalink and click “Save” after selecting a custom permalink structure. You may need to update your .htaccess file manually.
  2. If pages are randomly super cached and sometimes not, your blog can probably be viewed with and without the “www” prefix on the URL. Add this to your .htaccess above the Supercache and WordPress rules. Change example.com to your own hostname.
RewriteCond %{HTTP_HOST} www.example.com$ [NC]
RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]

The latest versions redirect themselves (you should always be running the latest version of WordPress anyway!)

WP Super Cache Error messages

  1. Anything in your PHP error_log?
  2. File locking errors such as “failed to acquire key 0x152b: Permission denied in…” or “Page not cached by WP Super Cache. Could not get mutex lock.” are a sign that you may have to use file locking. Edit wp-content/wp-cache-config.php and uncomment $use_flock = true or set $sem_id to a different value. You can also disable file locking from the Admin screen as a last resort.
  3. The error message, “WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed!” appears at the end of every page. Open the file wp-content/advanced-cache.php in your favourite editor. Is the path to wp-cache-phase1.php correct? This file will normally be in wp-content/plugins/wp-super-cache/. If it is not correct the caching engine will not load.
  4. The “white screen of death” or a blank page when you visit your site is almost always caused by a PHP error, but it may also be caused by APC. If you have trouble, disable that PHP extension and replace it with eAccelerator or Xcache.
  5. The error message, “WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory.” appears at the end of every page. You can delete wp-content/advanced-cache.php and reload the plugin settings page or edit wp-config.php and look for WPCACHEHOME and make sure it points at the wp-super-cache folder. This will normally be wp-content/plugins/wp-super-cache/ but you’ll likely need the full path to that file (so it’s easier to let the settings page fix it). If it is not correct the caching engine will not load.

Files and directories to check when using WP Super Cache

  1. Is there a wp-content/wp-cache-config.php ? If not, copy the file wp-super-cache/wp-cache-config-sample.php to wp-content/wp-cache-config.php and make sure WPCACHEHOME points at the right place.
  2. Is there a wp-content/advanced-cache.php ? If not, then you must copy wp-super-cache/advanced-cache.php into wp-content/. You must edit the file and change the path to point at the wp-super-cache folder.
  3. If pages are not cached at all, remove wp-content/advanced-cache.php and recreate it, following the advice above.
  4. Make sure the following line is in wp-config.php and it is ABOVE the require_once(ABSPATH.'wp-settings.php'); line:
define( 'WP_CACHE', true );
  1. Look in wp-content/cache/supercache/. Are there directories and files there?
  2. Set the variable $htaccess_path in wp-config.php or wp-cache-config.php to the path of your global .htaccess if the plugin is looking for that file in the wrong directory. This might happen if you have WordPress installed unusually.

Garbage collection issues

If you see garbage in your browser after enabling compression in the plugin, compression may already be enabled in your web server. In Apache you must disable mod_deflate, or in PHP zlib compression may be enabled. You can disable that in three ways. If you have root access, edit your php.ini and find the zlib.output_compression setting and make sure it’s “Off” or add this line to your .htaccess:

php_flag zlib.output_compression off

If that doesn’t work, add this line to your wp-config.php:

ini_set('zlib.output_compression', 0);

Garbage collection of old cache files won’t work if WordPress can’t find wp-cron.php. If your hostname resolves to 127.0.0.1, it could prevent the garbage collection from working. Check your access_logs for wp-cron.php entries. Do they return a 404 (file not found) or 200 code? If it’s 404 or you don’t see wp-cron.php anywhere, WordPress may be looking for that script in the wrong place. You should ask your server administrator to correct this or edit /etc/hosts on Unix servers and remove the following line. Your hostname must resolve to the external IP address other servers on the network/Internet use. A line like “127.0.0.1 localhost localhost.localdomain” is ok.

127.0.0.1 example.com

Use WP Crontrol to help diagnose garbage collection and preload problems. Use the plugin to make sure jobs are scheduled and for what time. Look for the wp_cache_gc and wp_cache_full_preload_hook jobs.

Miscellaneous WP Super Cache problems

  • Private Server users at Dreamhost should edit wp-content/wp-cache-config.php and set the cache dir to /tmp/ if they are getting errors about increasing CPU usage. See this discussion for more.
  • If old pages are being served to your visitors via Super Cache, you may be missing Apache modules (or their equivalents if you don’t use Apache). 3 modules are required: mod_mime, mod_headers and mod_expires. The last two are especially important for making sure browsers load new versions of existing pages on your site.
  • Caching doesn’t work. The timestamp on my blog keeps changing when I reload. Check that the path in your .htaccess rules matches where the supercache directory is. You may have to hardcode it. Try disabling supercache mode.
  • If supercache cache files are generated but not served, check the permissions on all your wp-content/cache/supercache folders (and each of wp-content cache and supercache folders) and wp-content/cache/.htaccess. If your PHP runs as a different user than Apache and permissions are strict, Apache may not be able to read the PHP-generated cache files. To fix you must add the following line to your wp-config.php (Add it above the WP_CACHE define.) Then clear your cache.
umask( 0022 );
  • If your blog refuses to load make sure your wp-config.php is correct. Are you missing an opening or closing PHP tag?
  • If your server is running into trouble because of the number of semaphores used by the plugin, it’s because your users are using file locking, which is not recommended (but is needed by a small number of users). You can globally disable file locking by defining the constant WPSC_DISABLE_LOCKING, or defining the constant WPSC_REMOVE_SEMAPHORE so that sem_remove() is called after every page is cached, but that seems to cause problems for other processes that request the same semaphore. Best to disable it.

Still need help?

Please contact support. We’re happy to advise.

  • Table Of Contents

  • Contact Us

    Need more help? Feel free to contact us.