Site down after installing an add-on? Get back into the Admin CP
If an add-on takes the whole site down, one line in config.php gets you back in. The safe way to recover, step by step.
Updated 4 min read By the D.C Style team
On this page
Before you start
Rarely, an add-on stops the whole site from loading: every page shows an error, including the Admin CP, so you cannot log in to disable it. XenForo has an emergency switch for exactly this. One line in src/config.php turns off every add-on's code so you can get back into the Admin CP, disable the add-on causing the problem, and put things right. Your data is not touched.
Signs you need this guide
- Every page, front end and Admin CP, shows a blank page, an HTTP 500 error or a raw PHP error.
- It started straight after installing, upgrading or enabling an add-on, or after your host changed your PHP version.
- You see Composer detected issues in your platform. That means an add-on needs a newer PHP version than your server runs. See the PHP section below.
If only some pages fail, or you can still open the Admin CP, you do not need the emergency switch. Start with finding the real error in the server error log.
Step 1: switch off add-on code
- Connect to your site by FTP, SFTP or your hosting file manager, and open
src/config.phpin your XenForo root. - Add this line at the end of the file and save it:
$config['enableListeners'] = false; - Load your Admin CP again. It should open, with a warning at the top: Code event listeners and extensions have been disabled via config.php. This is designed as an emergency measure to allow you to regain access to the control panel if an add-on blocks access and disable it.
This line stops add-ons from hooking into XenForo. That switches off their code event listeners and class extensions, and the libraries some add-ons load. Your forum runs as plain XenForo while it is in place.
Step 2: disable the add-on causing the problem
- Go to Add-ons.
- Disable the add-on you installed or upgraded just before the problem started.
- If you are not sure which one it is, Disable all switches every add-on off at once. XenForo remembers which ones it disabled, so you can re-enable those later in one step.
If you prefer SSH, you can disable one add-on from the command line once the line from Step 1 is in place. D.C Style add-on IDs start with DC/:
php cmd.php xf:addon-disable DC/GDA
Step 3: remove the emergency line
Delete $config['enableListeners'] = false; from src/config.php and load the forum again. It should now work normally, without the disabled add-on. Do not leave the line in place: XenForo itself warns that it is an emergency measure and not a debugging tool, and every add-on stays switched off while it is there.
Step 4: fix the cause, then enable it again
With the site back up, find out why the add-on failed before you switch it on again:
- Check the server error log. Logs > Server error log may have the error from when the site went down. How to read it.
- Check the files. A partial upload can break an add-on in odd ways. Run the file health check.
- Check the requirements. Compare the add-on's Compatibility section on its product page with your XenForo and PHP versions.
"Composer detected issues in your platform"
This message comes from a library bundled with an add-on. It means the add-on needs a newer PHP version than your server runs. The text after it names the version, for example: Your Composer dependencies require a PHP version ">= 8.1.0".
Among D.C Style add-ons, this applies to Google Drive Attachments, which needs PHP 8.1 or newer. It stops every page from loading on older PHP. You have two options:
- Upgrade PHP. Ask your host to move your site to PHP 8.1 or newer, or change it yourself in your hosting control panel. This is the better fix, as newer PHP is also faster and still receives security updates.
- Disable the add-on using the steps above until PHP is upgraded.
More on setting it up is in Set up Google Drive Attachments.
Tip: A backup taken before each install turns an outage like this into a quick restore. How to back up your forum.
Still stuck? Open a support ticket with the exact error you see, the add-on you installed or upgraded last, and your PHP version.