How to enable errors display and logging in hPanel?
In hPanel, you have 2 options on how to see PHP errors:
- For them to be displayed on the website directly
- For them to be stored in the log file.
In both cases, all you need to do is reach your control panel, then open Hosting → Manage → PHP configuration:
You will need PHP Options page.
- To make errors visible on your website directly, add a checkmark for display_errors parameter.
- To make errors logged in a specific file, mark log_errors:
Make sure to save changes before leaving the page 😊
How to enable errors display in WordPress?
If you are using WordPress, in the File Manager open your public_html/wp-config.php file. Check if it has this line:
If yes, change "false" to "true". Then, add a line:
That's it, not PHP errors will not be displayed on your WordPress website 😊
How to enable errors display via .htaccess?
To start logging your PHP errors to an error_log file of your choice add the following lines to your .htaccess file:
# log PHP errors to a file
php_flag log_errors on
php_value error_reporting 32767
php_value error_log "error_log.txt"
IMPORTANT: Make sure to make a backup of your previous .htaccess file before making any changes as incorrect settings can make your website inaccessible.
- These options will only display data about PHP errors, like Warning, Deprecated, Notice, etc. Errors like 503, Error establishing database connection and similar are not PHP errors, so they will not be stored in a log.
- How to turn off PHP error messages?