Fix ‘Blank page’ problem aka White Screen of Death

This is another interesting problem that baffles the novice PHP programmers.

We make a quick change, and upload the file to webserver, we access the webapge and your are presented with a blank white page, aka ‘white screen of death’. It does not even show any error message.

We end up thinking what happened, we refresh the webpage but usually nothing changes.

Why this happens?

This happens because your host has switched off error reporting(for good reasons). So whenever their is a fatal error in your PHP script, and you have error reporting turned off you are presented with white screen of death.

So how to remedy it?

Their are two ways to get out of this situation,

  1. Changes in php.ini file

If you can have access to php.ini file then change the display error property to On.

display_errors = On

Also make sure that error reporting property is at least set to

error_reporting  =  E_ALL & ~E_NOTICE & ~E_STRICT
  1. Changes in the file

In case where you don’t have access to php.ini file, you can set these property in PHP script itself. Simply add following at the very start of your PHP script

error_reporting(E_ALL);
ini_set('display_errors',TRUE);

If you are using some, open source package like Drupal, Joomla or WordPress then put these codes in the index.php file in the root directory, right at top.

It is also possible that even though you see a blank page, but when you view the source you see the whole html code. This happens when you might miss proper closing an html tag, like <script>,<object> etc.

Please note that white screen of death can also happen due to problems in your Internet connectivity, this usually remedies itself when you do a page refresh.

ok, this is my take on WSOD, what’s yours?

7 thoughts on “Fix ‘Blank page’ problem aka White Screen of Death

  1. After searching for a long time, your information was the only one I found that explained my problem and set me off on the right track to solving it.

    Thanks so much!

    Cheers,

    David.. TheACGTA.org

  2. Turning on error_reporting in Joomla’s index.php file solved this problem right quick. Thank you for the straightforward advice and quick fix!

    Respectfully,
    Dan

  3. i have turned on error reporting using the scripts you suggest, but I am still getting the WSOD.
    i have a joomla site, and it worked fine until about a week ago.
    i am confused why i don’t see any error messages even, i always get just the white screen.
    any other ideas?

  4. i have a joomla site that showing white death screen. but After using all these given solution i am still facing the same problem.

Comments are closed.