Roots Discourse

Uncaught Error: Class 'Roots\WPConfig\Config' not found/ 500 error

I’m attempting to migrate a site and received the site files and database which I uploaded to cpanel (shared host environment), but I’m receiving a 500 error. The error log lists the following: Uncaught Error:

Class ‘Roots\WPConfig\Config’ not found in /home/itjoes/apn.itjoes.com/public_html/config/application.php:42

I’ve been unable to find any reference to this error previously so I’m unsure how to deal with it. I’ve ensure composer, node JS and Yarn have been installed and configured the .env file but the problem persists.

1 Like

Are you using roots/Capistrano to deploy?

If yes, did you uncomment require 'capistrano/composer in your Capfile?

The reason I ask,
config/application.php has this use statement at the beginning:

use Roots\WPConfig\Config;

In order for this class to be usable, you need to run composer install during deployment to make sure that this dependency gets installed to the vendor folder:

"roots/wp-config": "1.0.0",

This class will be usable due to the vendor autoloading in web/wp-config.php. You can check if roots/wp-config was installed at vendor/roots/wp-config/src/Config.php.