How to check error logs in cPanel

Within cPanel, you have access to an error log section where you can conveniently observe the errors generated by your website. 

Our aim in this article is to provide a comprehensive overview of how you can access and examine both Apache and PHP error logs directly from your cPanel interface. 

What is the Error Log?

The Error Log, as described by cPanel, serves as a valuable resource for identifying issues within your website. 

With the ability to display the most recent 300 errors, it proves particularly useful in pinpointing broken links or missing files. 

Regularly reviewing this log can significantly contribute to the smooth operation of your site. 

When a visitor accesses your website, the server receives their browser and location information. 

If the visitor encounters an error while navigating your site, the error log captures essential details such as the date, time, IP address, and the specific page where the error occurred. 

These errors may arise due to various factors, such as:

  • Changes in page aliases (such as SEF URL or permalinks) 
  • File deletions or renames
  • Attempts by spam bots to manipulate URLs
  • Missing error pages or robots.txt files
  • Menu link changes without appropriate redirects
  • Outdated URLs cached in search engines.

It is crucial to stay vigilant and frequently monitor your error log to address any web crawler issues that may impact your search engine ranking and overall website functionality.

cPanel Error Log

To access your cPanel error log, follow these steps:

1. Log in to your cPanel account.

2. Navigate to Metrics > Errors.

3. Click on the cPanel error log icon.

The error log will be displayed in the designated box. cPanel allows you to view the last 300 errors through the Error Log interface.

How to read error log?

Here is a sample of a typical error entry in the cPanel Error log, showcasing a missing file and its brief description:

PHP Error Logging:

By default, InMotion has PHP error logging disabled on all servers. However, to troubleshoot your PHP code, you can enable PHP errors to be displayed and logged. 

This can be done either through your local php.ini file or by using ini_set() in a specific PHP file. 

Once enabled, any errors will be logged in a file named error_log, which will be located in the same directory where the script generated the error. 

For detailed instructions on enabling and logging PHP errors, refer to our comprehensive guide on “How to Display and log errors for PHP.”

Here is a sample of a php error log entry:

Within the error_log file, each error will be listed on a separate line, showing the date and time of occurrence followed by the actual error message. 

Regularly reviewing this log will help ensure the best possible experience for your website visitors, as it allows you to identify and address any recurring errors.

Was this article helpful?

Related Articles

Leave A Comment?