Loading...

Knowledge Base
Up to 75% off on hosting for WordPress websites and online stores

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.

Note: 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

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 2 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 with 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.

Note: At the bottom of the Error Logs page, you can limit each section's output to a specific number of lines. There is also a link to the Process Manager cPanel tool.
  1. Access File Manager.
  2. Look for error_log file, right-click, then click view.
    cpanel control panel file manager access file manager

Shared and Reseller

You can log in to cPanel and click the Error Log icon. 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.


Reading Error Logs

Tip: 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, and 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 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 knowledgebase for popular error messages (for example, 404 error or 500 error). A better resource strongly recommended for use is 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.

Research — What does the error message mean in the error log? If you do not know what the error message means, it's OK. A search in our knowledgebase provides support resources and troubleshooting tips, provides:
 
  • what the error is telling you,
  • what the error means, and
  • where the error is from (script, file, database, software tool, etc.) that needs some attention.
You will also see many additional recommendations online or a support page directly from the script or tool's creator containing different options to resolve the issue.

Looking for a specific error or error log? We have you covered! Below is a helpful list of knowledgebase support resource guides to 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
404 Error on Joomla — CMS Joomla: Common Errors
Custom Error Pages — Create and Customize
CGI Script — "File Not Found" or "No Such File or Directory"
Error Blank White Pages — WordPress White Screen of Death
Database Size and Table Limits
Error Establishing a Database Connection Page
Fatal Error: Allowed Memory Size
Fsockopen PHP Error — Troubleshoot Website Connectivity Issues
.htaccess SSL errors — How to Troubleshoot
Index of Error
MySQL Can’t Connect to Server
MySQL Database Error Messages
PHP Display Error Flags — How To Change or Troubleshoot display_errors PHP settings
PHP and Sending Email through SMTP — How To Configure WordPress Send Email
php.ini Error — How to Edit and Troubleshooting Tips for php.ini Configuration File
PHP Version Update Errors in WordPress
Ruby on Rails (RoR) Troubleshooting 404 Errors & Common RoR Errors
WordPress Core File — Related Errors
Zend Optimizer Common Issues Error Log


Common Error Log Terminology

Here are common error log terminology 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 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:
    • Parse or syntax error means you have a typo in the code, a wrong symbol, an unclosed quote missing, a misspelling of script syntax missing, 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.

Examples of how to Read an Error Log

Here is an example related to website files in the error logs, located in 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 errorrequire(): 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 there is an issue (typo, incorrect name, or special character used) causing an issue when someone tries to access an invalid URL. Check 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 the accessing 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.

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

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.

This example shows a web-crawler being blocked from making requests.

[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"] 


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.

If you need further assistance, feel free to contact us via Chat or Phone:

  • Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
  • Phone Support -
    • US: 888-401-4678
    • International: +1 801-765-9400

You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.

 
Did you find this article helpful?

 
* Your feedback is too short

Loading...