Documentation / How to find the PHP Error Logs

How to find the PHP Error Logs

In WordPress, PHP error logs are files that contain information about any errors or warnings that occur within the PHP code of your WordPress site. These logs are useful for troubleshooting issues with your WordPress site.

How to enable the WordPress Debug mode

To enable the PHP error log for WordPress you will need to connect to your site while using FTP and then edit the wp-config.php file

After you’ve opened this file you will need to add the following lines of code before the text where it says “That’s all, stop editing! Happy publishing.”

1
2
3
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
/* That's all, stop editing! Happy publishing. */

This code will enable debugging mode in WordPress and write any PHP errors to a log file.

NOTE: In case you already have ‘WP_DEBUG’ and ‘WP_DEBUG_LOG’ in that file, you will not have to do the above step, just make sure that they are set to true.

Where to view the WordPress Error logs

After you enabled WordPress Debug mode, you will need to go to the “wp-content” directory to find the “debug.log” file (again being connected to your site via FTP), then right-click on this file and choose to View/Edit the file.

 

After accessing the error log file, you will be able to review the error messages along with their corresponding date and time stamps.

 

It’s important to note that leaving debugging mode enabled on a production site can be a security risk, as it can reveal sensitive information about your site’s configuration and vulnerabilities. Be sure to disable debugging mode once you found the information you were looking for.

To disable the Debug mode, you will just need to set the WP_DEBUG and WP_DEBUG_LOG lines to “false”.

1
2
3
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_LOG', false );
/* That's all, stop editing! Happy publishing. */

In case you’re not experienced with connecting to your site via FTP or you were not successful in viewing the PHP Error Logs, please contact your hosting provider and ask them for help regarding this.

The Ultimate Membership Bundle

Combine the power of Profile Builder with Paid Member Subscriptions to set up user registration, memberships, and recurring revenue.

Get 25% off with the bundle

Help & Support

We’re here to help you every step of the way.

Open a Support Ticket