Pages

Monday, March 2, 2009

Have a Blank PHP Page?

So you're coding a PHP page, you switch to your browser and hit refresh, and you get -- nothin'. No error message, blank page, and depending upon your error settings, you may not see anything in the logs. You have display_errors turned on, so what's going on?
If you're using PHP 5.x, it may be a combination of two  things:
  1. You have white space somewhere.
  2. Output buffering is set to 4096 by default.
What's happening is that some sort of error has occurred in your code (or you have whitespace in an include before a header call) but the error output is being buffered by the output_buffering setting new to php.ini in 5.x and the error is being hidden.
If you have logging turned on, you would still see there error there, but this can otherwise be misleading.

No comments:

Post a Comment