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.
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/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:
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:
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:
755 and files should be 644. Fix permissions in File Manager by right-clicking and selecting Change Permissions..htaccess file for deny rules or incorrect directives. Temporarily rename it to .htaccess.bak to test if it is the cause.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 causes a 500 error. Rename the file to test. Check the error log for the specific syntax issue.public_html/error_log.777 or CGI scripts with wrong ownership can trigger 500 errors on hardened servers.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.
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:
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:
error_reporting = E_ALL
log_errors = On
error_log = /home/yourusername/public_html/error_log
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:
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.