The Dreaded White Screen and Other Errors
Errors Disabled
Sometimes during development the program will err and leave a white screen as error reporting is turned off.
But as administrator, you need to know what the error is. So Admin enables all error reporting. And there is an error in the main site, simply login to Admin and the error will be seen. Usually.
The main code starts with INDEX.PHP
which Admin does not use. The main code has a few include statements that Admin does not have. Errors in any of those cannot be detected by Admin. A Whitescreen with debug output enabled will indicate a location close to or even the file, but not the error.
For the included file there is a function available to provide the full PHP error, which is commented out. The includes are (about) line 40 in INDEX.PHP
and in the function call gmlp_open()
in DISPLAY.PHP
. The latter is for the post translations (TRANSFUNCS.PHP
), and if a translation function is missing or misnamed, an undetectable error will occur.
Warning And Notice Display
An error handler is installed and can be controlled in a number of ways in how to display errors (in ERROR.PHP
). It always issues a debug diagostic, but can display them to the screen with these CONFIG.INI
settings, initially set to 0
:
showerrors shownotices shownotfounds
The shownotices
of 1
displays E_NOTICE
messages, like for undefined variables. Undefined variables are actually common and harmless in some of the HTML templates.
The showerrors
setting can turn on the display of web template parse errors. Web templates are are loaded simply as data and are parsed when displayed. If a template has a parse error it will not be displayed.
The shownotfounds
setting can enable messages for missing web templates.
Editing The Site Live
The Admin editor prevents syntax errors in a template from being saved, but cannot detect spelling errors and typos that do not cause a parse error. Turning on debugging is recommended when editing files.
Notes- See the top of
INDEX.PHP
for how to turn on "maintenance mode". - In the previous releases there were a great many of these due to our excessive use of the PHP error operator,
@
, on accessing possibly undefined variables — we have fixed all of these. - As mentioned in the message above we will have a template editor that prevents errors from being saved.