The Dreaded White Screen
Sometimes during development a PHP program will err and leave a white screen. This is due to error messages being disabled by default. (Sometimes this can also be done at the PHP level by the display_errors
directive.)
THIS actually runs with an error reporting setting of:
error_reporting(E_ALL | E_STRICT | E_NOTICE);
Because we want to know of all possible problems. However, because the code has several data files that it loads it suppresses error reporting for errors related to those. This is partly because most of the data files can be edited on a live site.
There are a number of ways to show errors.
The first is the debug
CONFIG.INI
setting (see file DEBUGGING). Debugging output will only appear if Admin cookie is set (which is set by logging in the the Admin code). Setting debug = 1
will usually show the problem.
Other error reporting settings, which all default to zero, are:
shownotices showerrors shownotfounds failnotemplate
The shownotices
of zero turns off PHP's E_NOTICE setting when templates are displayed (like when a post is displayed). Undefined variables are actually common and harmless in the templates.
The showerrors
setting can turn on the display of web template parse errors. If a template has a parse error it will not be displayed.
The shownotfounds
setting can turn on notices for missing web templates.
The failnotemplate
setting will issue an exit if there is a missing or if there is a parse error in a PHP format data file (such as TRANSLATE.INI
or TEMPLATES.PHP
). Sometimes minor errors will not be so bad and this being off will allow the site to be displayed while being edited.
One of the reasons for suppressing template errors is when Admin is being used to adjust the site live. If a syntax error made it into a template, that template will be blank. The Admin will see this right away (and perhaps might have debug
set).
If Admin let a syntax error get into TRANSLATE.INI
, the post markup language, the site will still run, simply without the translations occurring.