This article discusses how to access the error log section in cPanel, which provides a detailed record of errors generated by your website. We’ll cover the steps for viewing error logs related to both Apache and PHP directly from within cPanel. Additionally, if you require more comprehensive information, we have a comprehensive guide that outlines the locations of various cPanel logs, including those for access, Apache, email, error, FTP, MySQL, and WHM.

What is the Error Log?

According to cPanel, accessing the error log function can aid in identifying issues with missing files or broken links on your website by displaying the most recent 300 errors. Regularly monitoring this log can help maintain the smooth operation of your site. Essentially, whenever a visitor attempts to access your website, their browser and location send a request to your server. If the visitor encounters an error while navigating your site, the error log records various details, such as the date, time, IP address, and page where the error occurred. Multiple factors can cause these errors. Here are a few examples of why such errors might occur.

  • Page Alias Changed (SEF URLs or Permalinks changed)
  • The file was deleted or renamed
  • SpamBots trying to manipulate a URL
  • Missing error pages or robots.txt
  • Menu links changed without redirecting
  • Old URLS cached in search engines

Frequently reviewing your error log can be beneficial in resolving web crawler issues that may impact your website’s functionality and search engine ranking. There are various reasons that could lead to errors on your site, underscoring the importance of regularly checking your error log.

cPanel Error Log

You can find your cPanel Error log by following the steps below.

  1. Login into your cPanel.
  2. Go to Metrics > Errors.
    cPanel error log icon
  3. Your error log will display in the box. cPanel will display the last 300 errors through the Error Log interface.
    cPanel error log sample

How do I read the error log?

Below is an excerpt of a typical error in the cPanel Error log. There are many different error types you may receive. Below is an error on a missing file with a brief description.

Date and Time logged Type Visitor IP Address [Fri May 17 21:07:47 2013] [error] [client 122.96.59.103] Location of the Error File does not exist: /home/userna5/public_html/400.shtml, Domain Referrer referer: https://example.com/?m=200911

PHP Error Logging

Hostifire has PHP error logging disabled on all servers as the default setting. However, to facilitate PHP code troubleshooting, errors can be enabled and logged by modifying the local php.ini file or using ini_set() in a designated PHP file. When errors occur, they will be recorded in the error_log file within the same directory as the script that generated the error. If you require additional details, our comprehensive guide on How to Display and Log Errors for PHP can be referenced.

php Error Log Sample

Within the file, you will see each error that was logged on a separate line. First, it will list the date and time that the error was produced, then the actual error. Reviewing this periodically will help you provide the best experience possible for your visitors to ensure that they are not seeing repeat errors on your website.

Author

Kamran

Leave a comment

Your email address will not be published.Required fields are marked *