You can view cPanel error logs directly from the WHM Terminal to identify issues affecting website performance or functionality. This process allows a server administrator to inspect logs in real-time without switching to a different interface.
Before you begin
You will need:
Root or administrative access to the WHM interface.
A valid WHM account with the permissions required to access the Terminal.
Accessing and viewing error logs
Log in to WHM.
Navigate to Server Configuration > Terminal.
Select the terminal session you wish to use.
To view the general cPanel error log, enter the following command:
tail -f /usr/local/cpanel/logs/error_log
To view the error logs for a specific website's public_html directory, navigate to the directory and use the following command:
tail -f /home/username/public_html/.error_log
Replace
usernamewith the actual cPanel account username and.error_logwith the specific log file name if it differs.
Note: The tail -f command will output new lines to the terminal in real-time. Press Ctrl+C to stop the live feed and return to the command prompt.
Confirm the result
The terminal will display the most recent entries from the specified log file.
New errors will appear in the terminal as they occur.
If the file is empty or does not exist, the command will return an error or show no output.
If the log file is not found
If you receive a "No such file or directory" error, verify the path to the log file. Different configurations may store logs in different locations. You can search for the log location using the find command:
find /home/username/public_html -name "*.log"
Limitations
This procedure only displays the content of the log files; it does not automatically resolve the underlying errors.
Accessing the terminal requires sufficient permissions to view the specific directory where the logs are stored.
If a website is using a custom error log path defined in the
.htaccessfile, the standard paths listed above may not contain the relevant data.
