When something goes wrong with your website, error logs are the first place to look for answers. They record every error, warning, and critical failure that occurs on your server, providing the precise information you need to diagnose and fix issues. This guide explains where to find error logs in cPanel, how to read them, and how to resolve the most common errors SakuraHost users encounter.

Pro Tip: Before contacting support about a website error, check your error logs first. Including relevant log entries in your support ticket dramatically speeds up the troubleshooting process.

Where to Find Error Logs in cPanel

Method 1: Metrics Section

The quickest way to view recent errors is through the Errors tool in cPanel. Navigate to Metrics → Errors. This displays the 300 most recent entries from your Apache error log, with the newest entries at the bottom. Each entry includes a timestamp, error severity level, client IP address, and a detailed error message.

Method 2: Raw Log Files via File Manager

For comprehensive log analysis, access the raw log files directly through File Manager. Error logs are located at:

/home/yourusername/logs/error.log      # Current Apache error log
/home/yourusername/logs/access.log     # Current Apache access log
/home/yourusername/public_html/error_log # PHP error log (if enabled)

The error.log file is maintained by Apache and records server-level errors. The error_log file (note the underscore) in public_html is generated by PHP and contains application-level errors.

Method 3: Terminal Access

For real-time log monitoring, use the cPanel Terminal (Advanced → Terminal) and run:

# View the last 50 error log entries
tail -n 50 ~/logs/error.log

# Monitor errors in real-time (press Ctrl+C to stop)
tail -f ~/logs/error.log

Understanding Error Log Format

Each error log entry follows a consistent format. Here is an example:

[Sat Mar 07 14:23:45.123456 2026] [php:error] [pid 12345] [client 196.41.xx.xx:54321] PHP Fatal error: Uncaught Error: Call to undefined function get_header() in /home/user/public_html/index.php:15

Breaking this down: [Date/Time] tells you exactly when the error occurred. [Module:Severity] identifies the source and severity level (emerg, alert, crit, error, warn, notice, info, debug). [pid] is the process ID. [client] is the visitor's IP address. The remaining text is the error message itself, including the file path and line number where the error occurred.

Common HTTP Errors and Solutions

403 Forbidden

This error means the server is refusing to fulfill the request, usually due to incorrect file permissions or a restrictive .htaccess rule.

Solutions:

Check file permissions. Directories should be 755 and files should be 644. Fix permissions in File Manager by right-clicking and selecting Change Permissions.
Review your .htaccess file for deny rules or incorrect directives. Temporarily rename it to .htaccess.bak to test if it is the cause.
Ensure there is a valid index file (index.html or index.php) in the directory. Without one, and with directory listing disabled, Apache returns a 403.

404 Not Found

The requested resource does not exist at the specified URL. This typically indicates a broken link, a deleted file, or a URL rewriting issue.

Solutions: Verify the file exists in the correct location. Check for case sensitivity issues (Linux servers are case-sensitive, so About.html is different from about.html). Verify that URL rewrite rules in .htaccess are correctly configured.

500 Internal Server Error

This is the most common and most frustrating error. It indicates a server-side problem that prevents the page from being generated. Common causes include:

.htaccess syntax errors: Even a single misplaced character in .htaccess causes a 500 error. Rename the file to test. Check the error log for the specific syntax issue.
PHP errors: Fatal PHP errors (memory exhaustion, undefined functions, syntax errors) produce 500 errors. Check the PHP error log at public_html/error_log.
Incorrect permissions: Files set to 777 or CGI scripts with wrong ownership can trigger 500 errors on hardened servers.
PHP version incompatibility: An application designed for PHP 8.1 may crash on PHP 8.3 due to deprecated functions. Use cPanel's MultiPHP Manager to switch PHP versions.

508 Resource Limit Reached

This error is specific to shared hosting and indicates that your account has exceeded its allocated CPU, memory, or I/O resources. Check the Resource Usage tool in cPanel under Metrics to see which limits were hit.

Recurring 508 Errors? This may indicate your website has outgrown its current hosting plan. Consider upgrading to a higher-tier plan at sakurahost.co.tz for increased resources and better performance.

Enabling PHP Error Display for Development

During development, you may want PHP errors displayed directly in the browser instead of only logged to a file. You can enable this temporarily using a .user.ini file or by adding the following to the top of your PHP script:

// Temporary debugging - REMOVE before going live
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

Alternatively, create a .user.ini file in your public_html directory:

display_errors = On
error_reporting = E_ALL
log_errors = On
error_log = /home/yourusername/public_html/error_log
Security Warning: Never leave display_errors enabled on a production website. Error messages can reveal sensitive information about your server configuration, file paths, and database credentials to potential attackers. Always disable error display and rely on log files for production debugging.

Managing Error Log File Size

Error logs can grow very large over time, especially if your site has recurring errors. A bloated error log consumes disk space and can slow down log analysis. To manage log file sizes:

# Check error log size
ls -lh ~/logs/error.log
ls -lh ~/public_html/error_log

# Clear the PHP error log
> ~/public_html/error_log

# Back up and clear
cp ~/public_html/error_log ~/public_html/error_log.bak
> ~/public_html/error_log

SakuraHost automatically rotates Apache logs, but PHP error logs in public_html are not rotated automatically. Periodically check and clear them, especially after resolving the errors that generated them.

When to Contact Support

If you encounter errors you cannot resolve after reviewing the logs, open a support ticket at billing.sakurahost.co.tz/submitticket.php. Include the error log entries, the URL(s) affected, and the steps you have already taken. For additional reading, refer to the cPanel Errors documentation.

Was this answer helpful? 0 Users Found This Useful (0 Votes)