Skip to content

White screen of death on a PHP site: turning a blank page back into an error

A PHP page loads completely blank with no error and a 200 status. The error is being hidden. Here is how to surface it from the logs and fix the underlying fault.

A white screen of death is a PHP page that returns nothing — no content, no error message, often an HTTP 200 — leaving you with a blank browser tab and no clue what failed. The error did happen; it is simply being swallowed because display_errors is off (correct for production) and you have not yet looked where PHP actually wrote it. The job is not to “fix the white screen” but to turn it back into a readable error, then fix what that error names. Nine times out of ten it is a fatal PHP error: a memory exhaustion, a missing extension, a syntax error in a recently edited file, or a broken plugin or theme.

What’s happening

When a PHP script hits a fatal error, PHP stops execution and decides whether to print the error or hide it based on display_errors. On a properly configured cPanel server display_errors is Off, so the visitor sees a blank page while the real message goes to the error log. The fatal itself is usually one of: memory_limit exhausted (Allowed memory size of N bytes exhausted), a missing or disabled extension the code calls (Call to undefined function for mysqli, gd, mbstring, curl, …), a syntax or type error introduced by an edit (syntax error, unexpected ... or an uncaught TypeError), a white page after a PHP version change because the code is incompatible with the new version, or — on WordPress and similar apps — a fatal in a plugin or theme loaded early enough to abort the whole page.

The reason it looks like “nothing happened” is that the HTTP status is often still 200 (the response started before the fatal) and the body is empty. So the first move is always to make the error visible, never to guess.

How to verify

Find the error PHP already logged. Check the per-account log, the docroot, and the PHP-FPM pool log.

# cPanel surfaces PHP errors per account here
tail -50 /home/<cpaneluser>/logs/<domain>.error.log
tail -50 /usr/local/apache/logs/error_log

# Many apps drop their own error_log in the document root
ls -la /home/<cpaneluser>/public_html/error_log
tail -50 /home/<cpaneluser>/public_html/error_log

# PHP-FPM logs per pool (cPanel default path)
tail -50 /opt/cpanel/ea-php*/root/usr/var/log/php-fpm/error.log

If nothing was logged, temporarily turn errors on for that account only (never server-wide on production) to force the message out, then revert.

# Which PHP version is this account on?
grep -i "<domain>" /etc/userdatadomains
# the ea-phpNN handler tells you the version

# One-off: enable display + logging in the account's php.ini / .user.ini
#   display_errors = On
#   log_errors = On
#   error_reporting = E_ALL
# (MultiPHP INI Editor in cPanel does this per account)

Confirm whether it is memory, an extension, or a version mismatch:

# Effective limits for this account's PHP
/opt/cpanel/ea-php81/root/usr/bin/php -i | grep -i memory_limit

# Is the extension the code needs actually loaded?
/opt/cpanel/ea-php81/root/usr/bin/php -m | grep -iE 'mysqli|gd|mbstring|curl|imagick'

# Syntax-check a file you just edited
/opt/cpanel/ea-php81/root/usr/bin/php -l /home/<cpaneluser>/public_html/wp-config.php

The fix

  1. Surface the error first — before anything else, get the message into a log via the paths above or by enabling display_errors for that account in cPanel » MultiPHP INI Editor. Every later step depends on knowing the actual fatal. A blank page is not diagnosable; an error line is. Turn display back off once you have read it.
  2. Memory exhausted — the log shows Allowed memory size ... exhausted. Raise memory_limit for that account in MultiPHP INI Editor (or a .user.ini / php.ini in the docroot) to a sane value such as 256M, then confirm with php -i | grep memory_limit. If a single request needs gigabytes, the code has a runaway loop or a huge import — fix that rather than raising the limit indefinitely.
  3. Missing extension — Call to undefined function mysqli_connect (or imagecreate, mb_strlen, curl_init) means the extension is not loaded for this PHP version. Enable it in cPanel » Select PHP Version » Extensions for that account, or server-wide via EasyApache 4 if every site needs it. Confirm with php -m.
  4. Syntax or type error from an edit — php -l on the recently changed file reports the exact line. Revert or fix it. A stray character in wp-config.php, .php config, or a theme functions.php is the classic cause of a site going blank “after I changed one thing.”
  5. Broke after a PHP version change — the white screen started right after switching versions in MultiPHP Manager. The code uses something removed in the newer version (e.g. legacy mysql_*, create_function). Either switch that account back to the prior version temporarily, or update the code; do not leave the account on an end-of-life version as a permanent fix.
  6. Plugin or theme fatal (WordPress) — the log names a file under wp-content/plugins/ or wp-content/themes/. Rename the offending plugin folder via File Manager to force-deactivate it (plugins/badplugin → plugins/badplugin.off), or switch to a default theme by renaming the active theme folder. Then reload; a working page confirms the culprit.
  7. OPcache serving stale bytecode — after fixing a file the white screen persists because OPcache cached the broken version. Reload PHP-FPM for that version (/scripts/restartsrv_apache_php_fpm) or flush OPcache so the corrected file is recompiled.

Once the log shows a clean request and the page renders, set display_errors back to Off for production and confirm the error log stays quiet on reload — a rendered page plus a silent log is the proof the fatal is gone, not just hidden again. Stack Harbor handles cPanel PHP fatal-error triage under managed cPanel operations — start a conversation.