Cannot Declare Class ComposerAutoLoader

Written by
Kyler
on October 25, 2018

We love WordPress, but the fact is that pulling data from a database just isn’t as fast as static files. A plain HTML-only site is always going to smoke a database driven site on similar hardware.

Unless you have a good caching plugin!

WP-Rocket WordPress Plugin

There are a few caching options out there to choose from. Even one by Automattic themselves.

For Outer Gain sites, we like the WP-Rocket plugin due to it’s extensive options, reliability and easy-to-launch installation. WP-Rocket has a lot of cool features like preloading off the site’s XML file that’s generated by All in One SEO, lazy loading images and videos, consolidating CSS and javascript… and much more.

2018 Issue: ComposerAutoLoader Error

Recently (fall of 2018) when cloning sites, we ran into an error on the new site that looked something like this:

PHP Fatal error: Cannot declare class ComposerAutoloaderInit 92972d118ced8ff642fe76cb6658cf52, because the name is already in use…

The new site would white screen and the above error was recorded in the nginx site log. Initially we thought it was something to do with the latest release of iThemes BackupBuddy, but soon realized it was the latest release of WP-Rocket v3.1.4.

If we deactivated WP-Rocket the site would load. If we tried to reactivate, the above message would show on the site dashboard.

The Solution

It turns out to be an issue with the advanced-cache.php file located in the site-root/wp-content/ folder. Deleting this file caused the Cannot declare class ComposerAutoLoader error message to vanish. We didn’t need to restart nginx or anything else.

You’ll need sFTP access to get to the advanced-cache.php file. Or at the least, some type of cPanel browser access.

Simply located that file and delete it. Then refresh the site. And when cloning, remember to also toast the cache file located in the /wp-content/wp-rocket-config/ folder.

Hope that helps!

Is Your Business Growing?
Are there potential customers you're not reaching? If you don't get to them, your competitors will. You must have a strategy. A solid online marketing plan. Do you know the difference between social media and website marketing? How are you growing your business online? Did you know SEO really works?
Get our FREE marketing tips below, and a coupon to save on Outer Gain!


Yes! Please add me to your list and send me the free marketing tips. I agree with site privacy and cookie policies.

Kyler and Sandi Boudreau
Written By
Kyler Boudreau

Kyler Boudreau lives with his wife and daughter on the beautiful island of Kauai. Kyler is an independent filmmaker (see theatereleven.com). His wife, Sandi Boudreau, is a Crown Diamond level distributor with Young Living.

Leave a Reply

Your email address will not be published. Required fields are marked *