How to find and read PHP error logs in WordPress

Jellybean, the OG Nexus mascot: How to find and read PHP error logs in WordPress

When a page goes blank, a feature stops working or you see "There has been a critical error on this website", the PHP error log usually tells you exactly why. Here is how to switch logging on, find the WordPress debug log and make sense of it, with two real cases from og-nexus.com.

Two real cases from our own site

Updates that never arrived. In November 2026 every OG plugin update failed with "A valid URL was not provided." The message came from WordPress's own download function, not from our code. WordPress only downloads from ports 80, 443 and 8080, and our update links used a different port. Version 1.0.2 of our updater allows that one port, for that one host, during the download.

A burst of 500 errors. On 30 November 2026 our server log showed 70 requests failing with a 500 error inside 16 minutes, and the words "possible dead lock" 161 times. No plugin was named, because no code was broken. A bulk SEO analysis was waiting on AI replies and had filled all 20 PHP workers. We raised the limit to 30.

The lesson from both: read the exact words first. When the log names no file, look at what the server was busy with at that time.

1. Turn on debug logging

Add these lines to wp-config.php, above the line that says "That's all, stop editing!":

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

This writes errors to a log file but never shows them to visitors. On a live site, never turn on WP_DEBUG_DISPLAY.

2. Find the log

WordPress writes to wp-content/debug.log by default. You can give WP_DEBUG_LOG a full path instead of true to keep the log outside the public web folder, which is safer.

Your server also keeps its own PHP error log. Its location is shown as error_log in Tools › Site Health › Info › Server, or ask your host.

In OG AI Core › Dashboard › Health, the Load Error Logs button reads the log for you and shows recent errors inside WordPress.

3. Reproduce the problem

Visit the page or repeat the action that fails, then look at the newest lines at the bottom of the log. Each entry has a date and time, so match it to when you tested.

4. Read the message

Fatal error: PHP stopped. This is what breaks pages. Fix these first.

Warning: something went wrong but PHP carried on. Worth fixing, as it often explains odd behaviour.

Notice and Deprecated: code that works today but may break on a future PHP or WordPress version.

Every entry ends with a file path and line number. The folder name tells you who to look at: wp-content/plugins/plugin-name/ points to that plugin, wp-content/themes/ to your theme. A "stack trace" below the message lists the chain of calls that led to the error, newest first.

5. Fix it

Update the plugin or theme named in the error; many errors are already fixed in a newer version.

If the error started after an update, roll that plugin back or deactivate it while you report the problem.

"Allowed memory size exhausted" means PHP ran out of memory: raise WP_MEMORY_LIMIT or find the code using so much.

"Call to undefined function" often means a plugin needs a PHP extension or another plugin that is missing.

Send the full error line and stack trace to the plugin's support team; it saves a lot of back and forth.

6. Tidy up afterwards

Set WP_DEBUG back to false once you are done, and delete or rotate large log files so they do not fill your disk. For problems in the browser rather than on the server, see our guide to the browser network and developer tools.

Further reading: WordPress Developer Resources: Debugging in WordPress