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
// Enable Debug logging to the /wp-content/debug.log file
// Disable display of errors and warnings
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.