This is an Error Message
This is a Success Message
This is an Informative Message

Topics: 15   |   Posts: 14   |   Comments: 12   |   Members: 233

  • 8
  • 0

PHP White Screen of Death

omari Thu Jun 21, 2012 - 08:29 am

Omari Celestine

If you have worked with PHP on a regular basis then there is the possibility that you have encountered a clean screen even with countless lines of PHP codes.

This is usually caused by a missing or misplaces ';', '}', ',' or ''' and you don't want this happening fi you have lots of unformatted codes.

To resolve this, there are a few steps you can take either to find or instantly resolve the problem.

First of all, this is something you should always take into consideration and recommend it to your friends. It may sound useless, but it would surely help you to faster find the point of penetration; Always comment each function or line of code you write. If you are now sure how it works, check out the sample below.


<?php
// Comment each line
fuction doSomething($string) {
    // Perform function

    return string;
}
?>



Next, something else you can try is that of enabling the display of all errors thrown in your PHP document. Not all errors are displayed by default so you might just be lucky and find the exact line where that error is occurring and why. You can do this by placing the following code to the top of your document where it can capture all operations coming after.


<?php
// Comment each line
ini_set('display_errors',1); 
 error_reporting(E_ALL);
?>



Finally, one of the most important steps you can take is that of continuous testing during development. Always ensure that you test each portion of code or function before you go ahead and publish your entire document just to find out that there are issues that needs your utmost attention.

Well, that's basically how this works and by following these simple steps, you should be safe from any issues.

0 ATTACHMENTS

Login or Register to leave a comment.

Topic Search
Get Started