How to View PHP Error Logs in cPanel

Knowledgebase / How to View PHP Error Logs in cPanel

How to View PHP Error Logs in cPanel

0 found helpful (0 votes) ...
Back to Knowledgebase

PHP error logs record every fatal error, warning, and notice generated by your PHP scripts. Reading the log is the fastest way to diagnose a blank page, a 500 error, or unexpected application behaviour.


View recent errors via cPanel Metrics

  1. Log in at https://tpc-hosting.com/login and open cPanel.
  2. Under Metrics, click Errors.
  3. The page shows the last 300 PHP and server errors across all domains on your account.
  4. Each entry includes: timestamp, error type, message, file path, and line number.

View the full error_log file

The Metrics view is limited to 300 entries. For the full log:

  1. Open File Manager and navigate to public_html (or your domain's document root).
  2. Enable Show Hidden Files from File Manager Settings if you do not see the file.
  3. Look for a file named error_log.
  4. Right-click it → View to read it in-browser, or Download to open it locally.

Enable PHP error logging if the file is missing

If there is no error_log file, PHP error logging may be disabled. Enable it via the MultiPHP INI Editor:

  1. Under Software, click MultiPHP INI Editor.
  2. Select your domain.
  3. Set log_errors to On.
  4. Set error_log to the path where you want the log saved, e.g., /home/yourusername/logs/php_errors.log
  5. Click Apply.

WordPress debug log

WordPress has its own logging mechanism. When debug mode is enabled, WordPress writes errors to wp-content/debug.log. To enable it, see: How to Enable WordPress Debug Mode.


Reading PHP error log entries

A typical error log line looks like this:

[26-Mar-2026 14:33:07 UTC] PHP Fatal error: Uncaught Error: Call to undefined function get_header() in /home/user/public_html/index.php on line 12
  • The timestamp tells you when the error occurred.
  • The error level (Fatal, Warning, Notice) tells you how severe it is.
  • The message tells you what went wrong.
  • The file path and line number tell you exactly where in the code the error originated.

Was this article helpful?



Still need help?

Open a support ticket →

On This Page