A WordPress critical error should be diagnosed with both the WordPress debug log and the PHP error log, because each one shows a different side of the failure. WordPress powers over 43% of all websites, so this error affects a huge number of businesses, blogs, stores, and membership sites [source: W3Techs]. The WordPress log usually points to plugin, theme, or core conflicts. The PHP log often shows deeper server issues, memory limits, version conflicts, file permission problems, or fatal PHP crashes.
TLDR: A site owner should check the WordPress debug log first when the site crashes after a plugin update, theme change, or code edit. The PHP error log should be checked when the error looks server related, repeats across several WordPress installs, or shows a blank white screen with no useful WordPress message. For example, if a store loses checkout access after updating five plugins, the WordPress log may name the failed plugin in seconds, while the PHP log may reveal that the real cause is a 128 MB memory limit hit during payment processing.
What the WordPress Critical Error Means
The message “There has been a critical error on this website” means PHP stopped running before WordPress could finish loading the page. That sounds simple. It rarely feels simple when the admin dashboard is locked and sales pages are down.
The failure may come from a bad plugin update, a broken custom function, a missing PHP extension, a theme conflict, or a server setting. WordPress tries to hide raw technical errors from visitors, which is safer. The drawback is obvious: the visible message gives almost no clue.
That is where logs matter. A log records what happened before the crash. The trick is knowing which log deserves attention first.
WordPress Error Logs: Best for Plugin, Theme, and Core Clues
The WordPress debug log is created when debugging is enabled in the wp-config.php file. It often appears as:
/wp-content/debug.log
This log is usually the fastest place to check after a crash caused by a WordPress action. That includes plugin updates, theme changes, custom snippets, WooCommerce changes, page builder updates, and failed core updates.
A typical WordPress log entry may show:
- Fatal error: Uncaught Error
- Plugin path:
/wp-content/plugins/example-plugin/ - Theme path:
/wp-content/themes/example-theme/ - Line number: the file line that triggered the error
That line number is useful. It may point straight to a plugin file or a custom code snippet. It saves time. It also prevents random guessing, which is how a five-minute fix turns into an afternoon of clicking and hoping.
The WordPress log is especially helpful when the site still loads partially. For example, the home page works, but the checkout page fails. Or the front end works, but the admin panel does not. In those cases, WordPress is alive enough to report its own pain.
PHP Error Logs: Best for Server-Level Problems
The PHP error log lives outside the WordPress application in many hosting setups. Its location depends on the host, control panel, server type, and PHP configuration.
Common locations include:
- cPanel error logs
- Hosting dashboard log viewers
/var/log/php_errors.log/var/log/apache2/error.log/var/log/nginx/error.log- Custom paths set in
php.ini
The PHP log is better when the issue starts before WordPress can record anything. This can happen with memory exhaustion, PHP version mismatches, disabled functions, missing extensions, file ownership errors, and fatal parse errors.
Honestly, it feels like some hosting panels hide these logs just to make simple repairs take 20 minutes longer than needed. A site owner may click through “Advanced,” “Metrics,” “Errors,” and “Logs” before finding the one screen that matters.
WordPress Logs vs PHP Logs: The Practical Difference
The difference is scope. WordPress logs explain application problems. PHP logs explain runtime and server problems. Both can mention the same fatal error, but each adds different context.
| Log Type | Best For | Common Clues |
|---|---|---|
| WordPress debug log | Plugins, themes, custom snippets, core files | Plugin name, theme file, hook, function, line number |
| PHP error log | Server config, memory, PHP versions, extensions | Memory limit, missing module, permission denied, parse error |
For a small brochure site, the WordPress log often solves most errors. For WooCommerce, LMS, booking, or membership sites, the PHP log becomes more valuable. Heavy plugins use more memory and depend on more PHP extensions. More moving parts means more ways to break.
Which Log Should Be Checked First?
The first log depends on what changed right before the failure.
- After a plugin update: check the WordPress debug log first.
- After a theme update: check the WordPress debug log first.
- After a PHP version change: check the PHP error log first.
- After a hosting migration: check the PHP error log first.
- After editing custom code: check both, starting with WordPress if the edit was inside the theme or a snippet plugin.
- When no log appears in WordPress: check the PHP error log immediately.
If the admin area is still reachable, plugin deactivation can be used for quick isolation. If the admin area is locked, plugins can be renamed through SFTP or the hosting file manager. That is blunt, but it works.
How to Enable the WordPress Debug Log
Debugging is usually enabled with these lines in wp-config.php:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
WP_DEBUG_DISPLAY should usually stay false on live sites. Public error messages can expose paths, plugin names, and server details. That information helps attackers. It also looks terrible to visitors.
After the error is fixed, debugging should be turned off unless the site has a safe logging policy. Logs can grow fast. A noisy plugin can add thousands of lines per day.
Common Critical Error Patterns
Several log entries appear again and again during WordPress critical error repairs:
- Allowed memory size exhausted: the site needs more PHP memory or a plugin is using too much.
- Call to undefined function: a plugin, theme, or PHP extension is missing or incompatible.
- Parse error: custom code has a syntax mistake.
- Class not found: a plugin file failed to load or an update was incomplete.
- Permission denied: file ownership or server permissions are wrong.
Expect to waste time on timestamps if the server time zone differs from the WordPress time zone. It drives people mad because the error may look unrelated at first. Matching the crash time, even roughly, is key.
A Simple Troubleshooting Workflow
- Confirm the exact error time. Refresh once, then record the time.
- Check the WordPress debug log. Look at the newest fatal error.
- Check the PHP error log. Compare entries from the same minute.
- Identify the path. Plugin, theme, core, or server path matters.
- Disable the suspected plugin or theme. Use SFTP if the dashboard is blocked.
- Raise memory only if needed. Do not mask broken code with huge limits.
- Restore from backup if the update broke production. Then test the update on staging.
The best result comes from reading both logs together. A WordPress log may blame a plugin. A PHP log may show the plugin failed only because the server runs an old PHP version. That distinction prevents the wrong fix.
FAQ
What is the best log for a WordPress critical error?
The WordPress debug log is best for plugin, theme, and WordPress code errors. The PHP error log is best for server, memory, version, and configuration errors.
Where is the WordPress debug log located?
It is usually found at /wp-content/debug.log after debugging is enabled in wp-config.php.
Why is the WordPress debug log empty?
WordPress may be crashing before it can write the log. Debugging may also be disabled, file permissions may block writing, or the error may be recorded only in the PHP log.
Should errors be displayed on a live WordPress site?
No. Errors should be logged, not shown to visitors. Public errors can expose sensitive technical details.
Can a plugin cause a PHP error?
Yes. A plugin can trigger memory exhaustion, call missing functions, or use code that fails under the active PHP version.
What should a site owner do if both logs are confusing?
The safest step is to copy the newest fatal error, disable the suspected plugin or theme, restore access, and ask the host or developer to review the matching PHP log entry.