Guide to Enabling WordPress Error Logs by Modifying wp-config.php

Guide to Enabling WordPress Error Logs by Modifying wp-config.php

When handling WordPress for accomplishing certain tasks, you may receive error messages. You get these messages in form of logs along with the codes.

You can view these errors and find out the resources responsible for it by making changes to the wp-config.php file. This file controls the database connections, helps you locate bugs, which you can then fix.

In this article, learn how to enable WordPress error logs by making changes to the wp-config.php file.

Using cPanel to Edit wp-config.php

There are multiple ways to accessing and editing the wp-config file. One of the easiest ways is to use the cPanel. If you have access to cPanel, it’s recommended that you go with cPanel. Otherwise, you can make use of FTP connection.

In this section, we’ll be using cPanel. Here are the steps involved:
  • Log into your cPanel account with the right credentials
  • Go into the “Files” section and then into File Manager
  • On the left hand side panel, you’ll see the directories. Find the public_html or the root directory
  • Select the domain folder you want to view the errors for
  • Go through the available files until you see the wp-config.php file. Right-click on it and then click on “Edit
  • For encoding confirmation, you need to confirm the pop up. Click on Edit
  • When the tab containing the code opens, add the following codes:
Code:
define( 'WP_DEBUG', true );
  • If the code already exist, then it would have been turned to “false.” Turn it to “true
  • Then add the following code to log in errors:
Code:
define( 'WP_DEBUG_LOG', true );
  • Save the changes made and exit
So that was it to enable WordPress error logs by modifying wp-config.php file. To check the login error, go into your wp-content folder. You’ll come across a newly-created file titled “debug.log”. Downloading this file will speed up the troubleshoot process.

Now whenever there’s a error within your WordPress website, you’ll be able to see it.
Author
kumkumsharma
Views
1,666
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top