Troubleshooting guide · website-errors · Published 2026-08-16 · 4 min read
PHP fatal error stops the site
PHP fatal error diagnosis and fix for blank pages and 500s, from the error log to memory limits and safe rollback.
- ·Symptoms
- ·Find the error
- ·Fix and prevent
Symptoms
A page that worked yesterday shows a blank white screen, returns HTTP 500, or errors on certain routes while the homepage loads. In WordPress, a fatal plugin error can blank the whole site including the admin. The common thread: PHP reached a condition it cannot recover from and the request died before the browser got a response body.
How a fatal differs from other errors
- Fatal error: the request stops. An uncaught exception, calling an undefined function (often after a plugin or library removed it), or parsing a file with a syntax error.
- Memory exhaustion:
Allowed memory size of N bytes exhausted. The script asked PHP for more memory than the limit allows; PHP aborts. Particularly common on large imports, media processing, and builders with long loops. - A warning or notice: printed but execution continues. It usually does not take the site down.
The blank screen and the 500 often share the same cause: the handler that would have rendered the error page cannot run because PHP died first.
Find the error
- Read the PHP error log first. Your host keeps one at a known path, or in cPanel at
logs/. WithWP_DEBUG_LOGon, WordPress writes adebug.loginwp-content/; without it, PHP writes to the server's error log. The line you want names the file and the line, and often the function. - Trigger it once in a controlled way. View the failing URL from a private window after enabling
WP_DEBUG_LOG(WordPress), ordisplay_errors = Onon a staging copy so the fatal prints to the screen in development only. Do not rundisplay_errors = Onon the live site. - Isolate by exclusion. Deactivate plugins one at a time (or via WP-CLI
wp plugin deactivate --all) and re-test; if the site returns, the fatality is in the last deactivated plugin. Then re-add until it breaks. PHP memory and fatal errors almost always trace to an add-on, a theme function, or a recent deploy.
The fix order
- Restore the previous code state. If the fatal appeared right after a plugin update or a deploy, roll the file or plugin back and the site works again. A copy of the previous version from a backup or from a staging copy resolves most of them. WordPress rollback is covered by the plugin rollback and restore articles.
- If memory is the cause, raise the PHP memory limit in the right file (
php.ini,.htaccess, or the WordPressWP_MEMORY_LIMITconstant). A limit of 256M is typical for a normal WordPress site. But a memory ceiling is a symptom, not the disease: a runaway loop or an array that never stops growing is the real work. Find what ate the memory and cap the data size before raising the limit. - Add a safe handler.
register_shutdown_functionto log fatal errors, or the site's error handler, catches them and writes the fatal without a blank screen. You then see the actual exception text. - Hold the change in staging. A fatal is a great index of the blast radius: the same function that died on the front page dies on the sitemap, the feed, and the admin. Fix and verify on staging, then release.
Prevention
- Commit a minimal error-log procedure:
WP_DEBUG_LOGon dev,display_errorsoff on live. - Update one add-on at a time and keep the previous version in a versioned folder.
- Monitor the error log after each deploy, not only when something visibly broke.
The blank page article covers the adjacent dead-screen cause, and the error-log-reading guide maps the log lines this article assumes.