Blank pages generated by Zikula and other PHP applications


Blank 'pages' in Zikula


By blank pages we're referring to an empty page received by the browser. In some browsers, viewing the source will show

<HTML><body></body></html>


What's the cause of these blank pages?


There is no one single cause and this is where the problem in diagnosis lies. The root cause is most commonly an error in one of the PHP files. We see a Blank Page because PHP has been configued to not display any errors generated by PHP scripts.

When you download PHP you find that two configuration files (php.ini files) are provided: one with default settings and one with recommended settings. The recommended configuration has display of errors turned off. So as we see having a Blank Page is not the root problem. We need to dig deeper in order to determine the actual error before any fix can be determined.

Re-configuring PHP to display errors


To identify the root cause, we need to get at the error being generated by PHP. How we do this depends on the level of access available to the server.

If you have access to update the server configuration then you can either alter your PHP configuration to turn on the displaying of errors to the browser or log errors to a file. To display errors in the browser set display_errors = On in php.ini. To log errors to a file set log_errors = On and provide a valid log file in error_log = filename (note 1)

If you don't have access to update the server configuration, the server you use is running Apache and the server allows .htaccess files, then the PHP configuration can be altered this way.

Create a .htaccess file in your Zikula site root (with index.php, admin.php, user.php etc.). Turn on displaying of errors to the browser with

php_flag display_errors on

If your server does not allow .htaccess files, you can add this to your config.php file to see errors (but be sure to turn it off when through debugging - leaving it on may expose information useful to hackers and will SURELY confuse ordinary users):



For other server configurations or problems with these directives seek help from either the server administrator, host, generic PHP support or operating system vendor.

What now?


You should now have access to the actual error generated either via the browser window or via the error log. At this point how you procede depends on the error message itself but it will have narrowed the places to look and avenues to seek further help on identifying the problem.

Notes

  1. If on a windows server you can log errors to the server event log using error_log = syslog


Back to the Knowledge Base

CategoryKnowledgeBase
XML Revisions of $tag
Page history :: Last Editor [ Operator ] :: Owner [ markwest ] ::