Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Fix ‘Blank page’ problem aka White Screen of Death  (Read 5260 times)

0 Members and 1 Guest are viewing this topic.

shijuc

  • Guest
Fix ‘Blank page’ problem aka White Screen of Death
« on: January 25, 2014, 12:23:30 pm »
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,

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
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.