In this article, I will explain 2 methods where you can find and view the server error logs in WordPress. Often my clients experience issues where their website suddenly stops working, displays a white screen, or even blocks access to the wp-admin area and they want to know which script/plugin caused the problem. So, to troubleshoot the error we need to access the error logs that make the process easier to pinpoint and solve the issue on the correct place. Here are some of the steps that help you to see the server error logs in WordPress.
4 Steps to View a Server Error Log in WordPress Using WP_DEBUG
- Login to your CPanel account and go to File Manager
- Go to the website directory folder inside the public_html and find the wp-config.php file. (This file is usually in the root directory of your WordPress installation)
- Now open the wp-config.php file in any editor, then search for the line that says:
/* That’s all, stop editing! Happy blogging. */
- Above that line, add the following code to enable debug mode:
define( 'WP_DEBUG', true );
(If you already see this line set tofalse
, simply change it totrue
to activate debugging. This line will turn on WordPress debug mode, which shows error and warnings on your site.
OR, you can try with the below method.
4 Steps to View a Server Error Log in WordPress Using WP_DEBUG_LOG (Optional but Recommended)
- Login to your CPanel account and go to File Manager
- Go to the website directory folder inside the public_html and find the wp-config.php file. (This file is usually in the root directory of your WordPress installation)
- Now open the wp-config.php file in any editor, then search for the line that says:
/* That’s all, stop editing! Happy blogging. */
- Directly below the
WP_DEBUG
line, add the following code to enable debug logs:
define( 'WP_DEBUG_LOG', true );
(After Save your changes then go back to directory or root and you will find another file named as debug.log that records any errors or warnings. You can view this file in a text editor to see all recorded errors, warnings, and notices.)
Finally, Enabling error logs in WordPress is a straightforward process that provides valuable insights into any issues on your site. With debug.log in place, you’ll have a dedicated log file capturing all important details, helping you troubleshoot and maintain a smooth-running WordPress site. If you are still facing the same error then you can contact our support team to examine your website thoroughly and solve the missing MySQL extension error.