How to enable debugging in a WordPress installation through cPanel Print

  • 0

Log in to your cPanel account.

Locate the "File Manager" icon and click on it to open the file management interface.

Navigate to the root directory of your WordPress installation, which is usually located in the "public_html" directory or a subdirectory within it (e.g., "public_html/yourdomain.com").

Find the "wp-config.php" file in the root directory of your WordPress installation. This file contains the configuration settings for your WordPress site.

Right-click on the "wp-config.php" file and select "Edit" or "Code Edit" from the context menu. A text editor window will open.

In the "wp-config.php" file, search for the line that reads:


/* That's all, stop editing! Happy publishing. */
Before that line, add the following lines of code to enable debugging:


// Enable WP_DEBUG mode
define('WP_DEBUG', true);

// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);

// Disable display of errors and warnings
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);
This will enable WordPress debugging, log the errors in a file named "debug.log" within the "wp-content" directory, and disable the display of errors and warnings on the frontend of your website.

Save the changes to the "wp-config.php" file and close the editor.

Now, when you encounter issues on your WordPress site, you can check the "debug.log" file within the "wp-content" directory to find detailed information about the errors. To access this file, use the cPanel File Manager or an FTP client.

Remember to disable debugging mode when you've resolved the issues, as leaving it enabled may pose a security risk and affect your site's performance. To disable debugging, revert the changes made in the "wp-config.php" file by removing the lines of code added earlier, and save the file.


Was this answer helpful?

« Back