Book a call Free rebuild

Error Log

August 16, 2022 Updated November 16, 2026 2 min read

Hosting glossaryAn error log is a file where a web server or application, such as PHP, records errors and warnings, which helps find the cause of a broken page.

When a page shows a blank screen, a 500 error, or WordPress's "There has been a critical error on this website", the visitor sees almost nothing about the cause. The details go to the error log: a plain text file where the web server or PHP records what went wrong, when, and where in the code.

Which error log?

A WordPress site can have several, and the one you need depends on the problem:

  • Web server error log: Apache's error_log or NGINX's error.log. It records server-level problems such as permission errors, missing files, misconfigured rewrite rules, and timeouts talking to PHP.
  • PHP error log: fatal errors, warnings, and notices from PHP code. On many cPanel hosts it appears as a file called error_log in the site's folder.
  • WordPress debug log: wp-content/debug.log, written when WordPress debugging is switched on.

Hosting control panels and managed hosts usually show recent errors in their dashboard as well.

Reading an entry

[16-Nov-2026 09:14:02 UTC] PHP Fatal error: Uncaught Error: Call to undefined function example_helper() in /home/site/public_html/wp-content/plugins/example-plugin/includes/init.php:42

Each entry has a timestamp, a severity, a message, and the file and line number. Severities run from Fatal error (the page stopped) through Warning and Notice to Deprecated (code that will break in a future PHP version). The file path is usually the most useful part: a path inside wp-content/plugins/ or wp-content/themes/ names the plugin or theme at fault.

Frequent culprits are a plugin that is not compatible with the site's PHP version, two plugins conflicting, "Allowed memory size exhausted" when a process runs out of memory, and a syntax error from a hand edit to functions.php.

Turning on the WordPress debug log

Add these lines to wp-config.php, above the line that says to stop editing:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Errors are then written to wp-content/debug.log instead of being shown on the page. WP_DEBUG_LOG also accepts a file path, which lets the log live outside the public web folder.

Common mistakes

  • Leaving debugging on. By default debug.log sits in a public folder, and anyone who requests it can read file paths and other details. Turn debugging off when you have finished, or log to a private path.
  • Displaying errors on a live site, which shows visitors, and attackers, internal paths.
  • Letting logs grow unchecked. A repeating warning can fill gigabytes of disk; fix the cause and rotate or clear old logs.

The error log explains failures; the access log shows which requests triggered them. For a step-by-step walkthrough, see our guide to WordPress error logs, and test fixes on a staging site before touching production.

Source: WordPress Advanced Administration Handbook, Debugging in WordPress.

HostList

The hosting directory with no paid rankings.

Compare 30,000+ web hosts and MSPs across 120+ countries, ranked by HRI, an independent 0 to 100 rating built from verified data. Find your perfect web host.