An important component to troubleshooting code on your website is to check the PHP error log for errors. This is where PHP warnings and/or errors are displayed. One question we often get from clients is How do I enable the PHP error log in cPanel?
This simple process will allow you to monitor errors and allow you to troubleshoot them.
PHP errors are found in the system log, in an inline with program execution or by using error monitoring tools.
In this blog, I am going to show you how to enable PHP error logging in cPanel. This is a quick and easy way to ensure the PHP error log is enabled so you can track any problems. Enabling this feature literally takes less than 30 seconds.
Steps to Enable PHP Error Log
The first step will be to login to the Client Area. Once logged in, Access cPanel. After you are in cPanel, scroll down to Software and go to Select PHP version.
Left click on the option and your screen will look like this:
By default, you will be on the PHP Extensions screen, as seen in the image above. Tick the option next to “Extensions” where it says “Options.”
Left click this option and you will be on the PHP Options screen. Locate the error_reporting field and ensure this is set to E_ALL. If you left click this field, a drop down menu will populate and you will be given the following options:
Ensure E_All has a checkmark by it. Once selected, you will receive a green “Success” notification that your changes have been saved.
Once you have received the green “Success” notification, PHP error reporting has been enabled. Now, you will be able to view warnings and/or errors that are populated in the PHP error log.