Skip to main content

How to Access Cpanel Error Logs for Troubleshooting

Understanding cPanel error logs is vital for swiftly identifying and resolving website issues. By analyzing these logs, you can pinpoint errors, optimize performance, and bolster security, ensuring a seamless online experience for users. This article will cover how to access error logs and what to look for when reviewing them. If you are looking for information on how to manage the error pages, please visit our article about Error Pages. To enable Debug Mode in WordPress, check out this article on How to Enable WP_Debug.

  • Error Logs Overview
  • How to Access cPanel Error Logs
  • Common Error Log Terminology
  • Reading Error Logs
  • Related Articles
  • Summary

Error Logs Overview

The cPanel Error Logs tool is useful when debugging scripts and finding missing files or broken links you may not be aware of. If the error messages you find are related to your website, and you are unsure what they mean or how to fix the issue, it is advisable to contact the script developer for further troubleshooting. There are two different sections of the Error Logs page you should be aware of:

Main Error Log

main error log for all websites on your server

This section shows the last few lines of the server's main error log. These lines are displayed in chronological order including the time, IP address of the visitor, and the error message. Because this is a shared server, you will see errors for all accounts on the server. If you are trying to locate error messages originating from your hosting account, you may need to refresh your URL, which has the error/problem, and then refresh the Error Logs page.

PHP Error Logs

The PHP Error Logs will show errors related to PHP scripts only for your account. These errors are sorted by directory and do not automatically disappear, as do the main error logs. The errors shown are stored in the error_log file within each directory. If you would like to clear the PHP error logs, simply delete the error log files in each directory using File Manager or FTP. cpanel control panel file manager access file manager

How to Access cPanel Error Logs

Shared and Reseller

  1. Log in to your Bluehost Account Manager.

  2. In the left-hand menu, click Websites.

  3. Click the MANAGE button located next to the website you want to manage. Bluehost Account Manager - Website Manage button

  4. On the OVERVIEW tab, click on CPANEL below. Multiple hosting plans - cPane Email link

  5. Your cPanel will open in a new tab. Bluehost Account Manager - Hosting Tab - Quick Links - cPanel button - cPanel Dashboard

  6. Scroll down to the Metrics section.

  7. Click the Errors icon. cPanel > Metrics section > Errors

This contains the last 300 Apache errors triggered by your website.

VPS and Dedicated Server

On a Dedicated Server or VPS without a cPanel installation, most log files would be located in the /var/log/ directory. The Apache log would be in the /var/log/httpd/ directory.

However, for our servers with cPanel installs, the Apache error log's actual location is /usr/local/apache/logs/error_log , where “error_log” is simply a plain text file.

Common Error Log Terminology

Here are common error log terminologies you may see:

  • 'File does not exist' - The file is in the wrong place or will need to be republished. All your files and folders should be uploaded inside the [public_html] for the primary domain name or the appropriate [subdomain folder] for the addon domains.
  • Permission denied: The item (file or user) does not have permission to access. This guide will show you: How to Change File Permissions.

Here are common databases (such as PHP) and other types of error log terminology you may see:

  • Error Log Type - Warning Error:
  • The cause is usually a file path that does not exist. Recommendation: Check the file name on the script or directory for a typo and the file’s location.
  • Error Log Type - Notice Error:
  • The cause is usually an undefined variable.
  • The execution of the script will, in most cases, still run.
  • Error Log Type - Parse Error or Syntax Error:
  • A Parse or syntax error means you have a typo in the code, a wrong symbol, an unclosed quote, a misspelling of script syntax, etc. It can stop the script and trigger an error message or an error message on WordPress sites.
  • The error log will provide specific details about what caused it, the file, and the code line, so you know exactly where to go to fix the syntax error.
  • Error Log Type - Fatal Error:
  • A fatal error may occur for a few reasons: when the script/database attempts to perform an action or function, but something is missing or does not exist in the location where the script/database code is told to pull the data. In other words, where the script/database needs to look and pull the data, it needs to be defined clearly or more accurately.
  • It cannot run the code script/database installed or during the program execution.
  • A fatal error may crash the application.

Reading Error Logs

If you want to quickly jump around to focus on or look for something specific, use

  • "CTRL " + "F " (for Windows) or
  • "Command " + "F " (for Mac).

Jump around and find specific things you wish to look for faster (whole or partial words, numbers, IP addresses, pieces of code, etc.). The options are endless! Error Log output results you view will vary, and they may not always be the same or appear similar. Each line is a log (or record), providing information about the code for your review that may need attention. Each error log contains some basic information, such as:

  • Timestamp — Date and Time.
  • IP Address — Identifies a visitor’s or a script’s location where they are in the world when a website is visited, or a script accesses a database to perform a task.
  • Name of the File, Folder, or Database — Error logs provide the name of the file or folder. This applies to all files or folders (e.g., .html, .php, etc.).
  • File/Folder/Database directory’s location — Includes the file name, as mentioned above. In most cases, error logs usually provide the specific location of a file, folder, or directory. This can sometimes include opposite information; the error message from the script may also alert you where it attempted to look for specific data, and it did not exist or was not found, so one can make necessary adjustments to the website or database files.
  • Error messages and numbers — The log provides a specific error message. Helpful information may be available in this knowledge base for popular error messages (for example, 404 error or 500 error). A better resource strongly recommended for use is the support pages provided by the script, software, or database creator. Typically, their resources provide greater detail explaining what the error means and how to fix the error.

Examples of How to Read an Error Log

Here is an example related to website files in the error logs, located in the PHP error logs providing great information informing it cannot locate the specific file/folder/directory, including the exact file, folder/directory, and specific line number on the database to review.


[03-Jul-2024 14:10:12 UTC] PHP Fatal error: require(): Failed opening required 'EXAMPLEFOLDER/blocks/a-coolexample-widget.php' (include_path='.:/opt/cpanel/ea-php74/root/usr/share/FOLDERNAME') in /home/exampledatabaseusername/public_html/wp-includes/blocks/index.php on line 11


Here is an example related to a cPanel error log informing that there is an issue (typo, incorrect name, or special character used) causing an issue when someone tries to access an invalid URL. Check that the file name is correct, and it is also recommended to review cPanel/logs/access_log to view who is attempting to access the URL and if you should block their IP or update access to the URL.


[2024-01-31 00:42:24 -0700] warn [whostmgrd] (XID 000000) Documents are not permitted to contain null characters, or new lines. at filename.extension line 3292, <EXPLE> line 2.
cpanel::cpsrvd::parse_request_headers() called at filename.extension line 1845


Here is an example of a cPanel error log notifying a 'file does not exist', meaning it was unfortunately not located in the folder based on where the program/script says to look for that information.


[Fri Oct 07 12:34:00 2014] [error] [client 227.27.27.2] File does not exist: /home/etc/public_html/Foldername


Here is an example of an Apache error log notifying that a file or folder is not found or present.


[Wed Jul 03 11:12:13.111111 2024] [:error] [pid 20202:tid 12345678987654321] [client 101.110.10.10:45678] File does not exist: /var/www/html/phpinfo.php


Here is an example of an Apache/cPanel error log with a ‘modsec’ (security) alert. If a script or part of a script is blocked or cannot execute properly as the script or database was programmed to function, the action or request may look like this. This example shows a web-crawler ('crawler') with a specific name ('ExampleWebCrawlerbot') is viewed as a potential (‘security’) risk.


[Wed Jul 03 17:12:24.000000 2024] [security2:error] [pid 437700:tid 22533470926592] [client 01.01.127.001:0] [client 01.01.127.001] ModSecurity: Access denied with code 406 (phase 1). Pattern match "ExampleWebCrawlerbot/[0-9]" at REQUEST_HEADERS:User-Agent. [file "/opt/mod_security/EXAMPLE_rules.conf"] [line "587"] [id "999888"] [msg "Problematic Crawler"] [hostname "domainexample.com"] [uri "/magicalunicorn-conjunct-axis-symmetry/"] [unique_id "ZoXz2Xz08_Z1XzxZXZXzxzxZZZZz"]


As a precaution, it is being blocked ('Access denied'), and you should investigate the code script/database. The block may need to be lifted to function correctly. The error log’s helpful info below provides the date and IP address where the request is coming from, including the exact file, database, and even the name of the script. Like any computer, mobile phone, email, or server, systems will attempt to protect you automatically; sometimes, you may need to let the system or server know an item is safe to prevent it from future blocks.

Some web crawlers are embedded in code or installed to be used for website SEO/marketing purposes.

Looking for a specific error or error log? We have you covered! Below is a helpful list of knowledge base support resource guides for troubleshooting and tips for error logs.:

  • 400 Errors and PHP — Related Error Codes: 403 Error, 404 Error, and 429 Error
  • 500 Error — PHP Scripts
  • 500 Error Code — What Is and How To Fix 500 Internal Server Error
  • 500 Error Code for VPS & Dedicated Servers
  • 502 Error Code — Bad Gateway Error
  • Error Blank White Pages — WordPress White Screen of Death
  • Error Establishing a Database Connection Page
  • Fatal Error: Allowed Memory Size
  • Index of Error
  • MySQL Database Error Messages
  • PHP Display Error Flags — How To Change or Troubleshoot display_errors PHP settings
  • PHP Version Update Errors in WordPress
  • Ruby on Rails (RoR) Troubleshooting 404 Errors & Common RoR Errors
  • How to Troubleshoot and Repair WordPress Core Files

Summary

Understanding these logs helps identify errors, optimize performance, and enhance security for a smoother user experience. Accessing them involves navigating through cPanel's error logs section, where you can view both main server errors and PHP-specific errors. Depending on your hosting setup, the location of these logs may vary, but they provide valuable information for troubleshooting and maintaining your website's functionality and security.