How to Fix WordPress White Screen of Death by Raising PHP Memory Limit

This guide explains why insufficient PHP memory triggers the WordPress White Screen of Death and provides three step‑by‑step methods—editing wp‑config.php, php.ini, or .user.ini—to increase the memory limit and restore site functionality.

php Courses
php Courses
php Courses
How to Fix WordPress White Screen of Death by Raising PHP Memory Limit

If you encounter a completely white page while managing or browsing your WordPress site, you are likely facing the WordPress White Screen of Death (WSOD), often caused by insufficient PHP memory.

1. Why PHP memory shortage leads to a white screen

WordPress core, themes, and plugins execute PHP code that consumes server RAM. When a powerful theme, many plugins, or large data imports require more memory than the default PHP limit, the script is terminated silently, resulting in a blank page.

2. Fix: Increase PHP memory limit

Three common methods are listed below; try them in order.

Method 1: Edit wp-config.php (most common)

Connect to your server via FTP/SFTP or a file manager such as cPanel.

Locate and download the wp-config.php file in the WordPress root (alongside wp-content and wp-admin).

Open the file in a text editor.

Find a line similar to define('DB_COLLATE', '');.

Above that line, add the following code:

define('WP_MEMORY_LIMIT', '256M');
256M

sets the limit to 256 MB; you can start with 128M or 256M and increase to 512M for very large sites.

This setting applies to both the admin dashboard and the front‑end.

Save the file and re‑upload it, overwriting the original.

Refresh your site to see if the white screen is resolved.

Method 2: Edit php.ini (requires host support)

Using FTP or the file manager, locate your website’s root or /public_html (or /httpdocs) directory.

Find the php.ini file; if it does not exist, create one.

Add or modify the line: memory_limit = 256M Save and upload the file.

After changing php.ini, restart Apache or Nginx (via your hosting control panel or by contacting the provider) for the changes to take effect.

Method 3: Use .user.ini (alternative to php.ini )

Create or edit a .user.ini file in the site’s root directory.

Add the following line: memory_limit = 256M Save and upload the file.

Changes may take a few minutes to several hours to apply because .user.ini is cached (typically for 300 seconds).

3. Follow‑up steps and precautions

Verify the new limit with a plugin like “Health Check & Troubleshooting” or by creating an info.php file that calls phpinfo().

Do not set the limit excessively high; a reasonable value that keeps the site stable is sufficient.

If you are unsure about editing server files, contact your hosting provider for assistance.

If the white screen persists, investigate other causes such as problematic plugins or themes, PHP version incompatibility, a corrupted .htaccess file, or damaged core files.

Enable debugging by adding define('WP_DEBUG', true); to wp-config.php to obtain detailed error messages for further troubleshooting.

In summary, increasing the PHP memory limit is often the quickest way to resolve a WordPress WSOD caused by resource exhaustion, restoring your site to normal operation.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

debuggingPHPserver configurationWordPressmemory_limitWSOD
php Courses
Written by

php Courses

php中文网's platform for the latest courses and technical articles, helping PHP learners advance quickly.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.