How to enable debug mode in CMS
There are situations when a website running CMS stops working correctly and displays a white page instead of the content we are used to. And it is not obvious enough what exactly happened and how to fix it.
To solve such problems, CMS developers have introduced debugging mode, which will help to find out the cause of difficulties, and will sometimes tell you how to solve it or in what direction to proceed.
Please be aware that debug mode may display sensitive data and error information on the public part of your site.
WordPress
To enable debug mode in WordPress, you need to make the appropriate changes to the wp-config.php file. This way, WordPress will output more detailed error messages.
- Find the wp-config.php file. The wp-config.php file is located in the root folder of your website where WordPress is installed.
- Open the file in an editor. You can use the standard dashboard editor. If needed, you can use our article How to edit website files using the hosting control panel.
- In the wp-config.php file, find the line with WP_DEBUG. It usually looks like this:
define('WP_DEBUG', false);
Change the value of the constant to true. As a result, the string should look like this:
define('WP_DEBUG', true);
After making the changes, save the wp-config.php file.
Now the debugging mode is enabled, you can go to your site and see if additional error messages appear. Sometimes the errors may indicate that a particular plugin is not working properly. In this case, it will be enough to rename the plugin in the file manager or disable it in the admin panel, if it is available. If the error indicates incorrect syntax in some configuration file, usually the path to this file and the line in it, where you should look for the error (perhaps an extra character was inserted by mistake), are indicated.
Additionally, besides changing WP_DEBUG, you can also enable error output and logging to see more detailed error information. To do this, add the following code under the definition:
define(‘WP_DEBUG_DISPLAY’, true);
define(‘WP_DEBUG_LOG’, true);
As a result, your lines should look like this:
define('WP_DEBUG', true); define('WP_DEBUG_DISPLAY', true); define('WP_DEBUG_LOG', true);
WP_DEBUG_DISPLAY: Display errors on the screen. If true, errors will be displayed on the page. If false, errors will not be displayed.
WP_DEBUG_LOG: Write errors to a log file. If true, errors will be written to the debug.log file in the wp-content folder.
After making changes, save the wp-config.php file.
If you have difficulties with error interpretation or just need help, you can always contact our support team. Although we are not professional developers, we will check and advise you in which direction you can look for a solution.
Joomla
If the administrative panel of your site is working correctly, you can enable error display in it.
To do this, just go to the System section, select Global
In the next window, open the System tab and set the switch for the Debug System field to Yes. Click Save to save the changes.
After that, go to the Server tab and set the Error Reporting field to Maximum. Click Save to save the changes.
OpenCart
By default, when a site error occurs on OpenCart, just a white screen is displayed. The easiest way to enable error display is to edit the index.php file.
If the error occurs on the site – then you need to edit the index.php file, which is located in the main (root) folder of your site.
If errors are observed in the administrative panel of the site – in this case you need to edit the file index.php, which is located in the directory admin/index.php
Open the file in an editor. You can use the standard dashboard editor. If needed, you can use our article How to edit website files using the hosting control panel.
After the first line, which would normally appear as <?php, insert the following lines (without deleting anything below):
ini_set('error_reporting', E_ALL); ini_set('display_errors', 1); ini_set('display_startup_errors', 1);
So, the beginning of your file should look like this:
<?php ini_set('error_reporting', E_ALL); ini_set('display_errors', 1); ini_set('display_startup_errors', 1);
Save the index.php file.
Go to the page where the white screen was observed and refresh it. The error information should appear.