Error Logs comes in handy to figure out the problem on your WordPress website. Users can find out what is the reason behind the downtime on the website. In this guide we are going to go through the steps required to enable WordPress Debugging and Error Logs, locating the error_logs in the WordPress website.
Location of Debugging and Error Logs :
- error_logs are present in the root directory of the website it is a PHP log generated by the webserver. In some web servers, it’s disabled.
- In the root directory of the website head to the wp-content folder debug.log is the log file.
Note: If you don’t see error logs in the root directory then you have to enable Debugging in the website.
Steps to enable Debugging and Error Logs :
- Login in to your FTP/File Manager.
- Head to the root directory of your website.
Open the wp-config.php file in edit mode.
Add the following code to the website.
// 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 );
// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( ‘SCRIPT_DEBUG’, true );
- You must insert the code BEFORE /* That’s all, stop editing! Happy blogging. */ in the wp-config.php file.
- By default “define( ‘WP_DEBUG’, false );” might be there already in the wp-config.php file, so you can remove it or change the false variable to true
- Save the wp-config.php file and reload the website in any browser.
- Access the website in the browser so that logs are generated after enabling in the wp-config.php file.
- Check the wp-content directory for the debug.log file. This will contain the error logs from your WordPress Website.
Setup for WordPress Debugging and Error Logs is complete, Now you can open the error log file and check the errors to troubleshoot the problems in the website.
Some common error and their solutions :
The White Screen of Death
- A Plugin is causing compatibility issues. If you can access the WP-Admin of your website try deactivating all of your Plugins and then reactivating them one by one. If you are not able to access your Admin page, Head to file manager in cPanel, Locate the folder wp-content/plugins and rename the Plugin folder to plugins_old. This will deactivate all of your Plugins.
Internal Server Error
- The most likely issue is a corrupted .htaccess file. Follow the following guide to create a new .htaccess file.
Head over to the detailed WordPress Debugging guide below.
[FIXED]The site is experiencing technical difficulties error