Setup PHP error logging
When troubleshooting PHP errors, you will want to review your PHP logs. If you don't have PHP logs to review, use the following process to set up logging:
Note: For WordPress and Managed WordPress error logging please see Enable WordPress debug mode to display errors.
- You should always backup your site before making any changes to your site.
- Locate your PHP initialization file.
- Edit the file. (Web Hosting (cPanel) / Windows Hosting (Plesk) / VPS Hosting)
- Place the following line in your initialization file:
error_log = /path/to/your/webroot/php_error.log
- error_log is the PHP function that will tell the web server to output your logs to a new file.
/path/to/your/webroot/php_error.log
is the path to your new log.
- Make sure to replace
/path/to/your/webroot
with the actual path your hosting account uses. - What is my absolute path? (
Web Hosting (cPanel) / Windows Hosting (Plesk) ). - Create the a file named php_error.log in the in the webroot of your hosting.
- Restart your PHP processes.(
Web Hosting (cPanel) / Windows Hosting (Plesk) ).
Next steps
- Review your php_error.log for error details. (
Web Hosting (cPanel) / Windows Hosting (Plesk) / VPS Hosting )
More info
- For more information about PHP error logs, visit PHP.net.