When a website hosted on a cPanel server starts throwing errors like 500 Internal Server Error, blank pages, or random script failures, the first place you should look is the error logs. These logs provide direct insight into what went wrong whether it’s a broken .htaccess
rule, a missing PHP file, or a permissions issue.
At EglueWeb, we’ve handled thousands of support cases where simply reading the error logs led to a quick resolution. In this blog, we’ll walk you through how to analyze Apache error logs, PHP error logs, and apply the findings to fix common problems.
Step 1: Access Error Logs via cPanel
Log in to your client’s cPanel account and look for:
- Metrics > Errors
This tool displays the last 300 Apache errors for your account.
You’ll see entries like:
[Sat Jun 22 10:25:31.234567 2025] [core:error] [pid 12345] [client 192.168.1.1:54321] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary.
This gives a quick overview of the most recent problems affecting website accessibility.
Step 2: Understand Apache Error Log Messages
Apache error logs include:
- Timestamps – When the issue occurred
- Client IP – The visitor’s IP triggering the error
- Error Type – Example:
AH00124
,File does not exist
,Permission denied
- File Path – The location causing the error
Examples & Fixes:
File does not exist: /home/user/public_html/favicon.ico
- Not critical, just a missing favicon.
- Solution: Upload the missing file or ignore.
AH00037: Symbolic link not allowed or link target not accessible
- Broken symlink or restrictive
Options -FollowSymLinks
. - Solution: Fix the symlink or update
.htaccess
.
- Broken symlink or restrictive
AH00124: Request exceeded the limit of 10 internal redirects
- Likely due to a faulty rewrite rule in
.htaccess
. - Solution: Review and correct rewrite conditions.
- Likely due to a faulty rewrite rule in
Step 3: Locate Full Apache Logs in File System (Advanced)
For deeper analysis, especially when Errors > 300 lines:
Via SSH or File Manager:
/home/username/logs/error_log
Or (for global view, WHM/root):
/usr/local/apache/logs/error_log
You can tail the log in real-time:
tail -f /usr/local/apache/logs/error_log
Step 4: Check PHP Error Logs
If the Apache log doesn’t give enough detail, look at PHP error logs. These often reveal:
- Deprecated functions
- Memory exhaustion
- Parse errors
- Uncaught exceptions
Location in cPanel:
- Metrics > Errors (includes PHP errors if display_errors is off)
- If
error_log
file is present inside the site root (/public_html/error_log
), open it.
Typical Entry:
[25-Jun-2025 13:44:56] PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/user/public_html/db.php:4
Fix: Update code to use mysqli_connect()
or PDO, as mysql_connect()
is deprecated.
Step 5: Enable PHP Error Logging (If Not Enabled)
If you don’t see PHP errors:
- Go to cPanel > Software > MultiPHP INI Editor
- Enable:
display_errors = Off
(for production)log_errors = On
- Set
error_log
to:/home/username/logs/php_error.log
or leave blank for default.
- Set proper
error_reporting
:error_reporting = E_ALL
Step 6: Fix Common Issues Based on Logs
Error Message | Likely Cause | Fix |
---|---|---|
Permission denied |
File or folder permission issue | Set correct permissions (e.g., 644 for files, 755 for folders) |
Maximum execution time exceeded |
Script taking too long | Optimize code or increase max_execution_time |
Allowed memory size exhausted |
PHP script using too much memory | Increase memory_limit in php.ini |
Cannot redeclare function |
Duplicate function declaration | Fix logic or include checks |
Call to undefined function |
Missing extension or outdated PHP | Enable extension via Select PHP Version |
Step 7: Use WHM for Global Monitoring (for Hosting Providers)
For sysadmins or hosting companies:
- WHM > Apache Status – Real-time view of what’s being processed
- WHM > Raw Access Logs – Download full access and error logs
- WHM > MultiPHP Manager – Adjust PHP settings per domain
Conclusion
Knowing how to read and interpret cPanel’s error logs is essential for diagnosing and resolving website issues quickly. Whether you’re troubleshooting a simple 404 error or a complex PHP fatal error, the logs give you the evidence you need to act confidently.
At EglueWeb, we always recommend reviewing these logs as a first step before escalating or applying blanket fixes. It saves time, improves resolution rates, and ultimately enhances client satisfaction. For hosting companies, training your support staff on error log analysis is one of the most cost-effective ways to reduce downtime and support volume.su