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.
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.
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.
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.
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