PostNuke Community

Support at your fingertips

Blank pages generated by PostNuke and other php applications  Top

  • Blank 'pages' in PN

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



    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 a default and a recommended. 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 PN root (with index.php, admin.php, user.php etc.). Turn on displaying of errors to the browser with

    php_flag display_errors on

    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

    --
    Visit My homepage and Zikula themes.
  • Note - This post IS NOT a central place to post errors relating to every single Blank Page issue in PN but a short tutorial on how to get to the root cause. Once the root cause has been identified seek support on the problem via the correct channels.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • I might add that if you have errors set to be reported (within php.ini) and you are still getting "blank pages" open pnAPI.php and change

    Code

    // proper error_repoting
    // E_ALL for development
    //error_reporting(E_ALL);
    // without warnings and notices for release
       error_reporting(e_all & ~e_notice & ~e_warning);


    to

    Code

    // proper error_repoting
    // E_ALL for development
        error_reporting(e_all);
    // without warnings and notices for release
    // error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);


    this begins on line 298 in pnAPI.php.
  • hint from the QA: Never develop a application that does hide errors and warnings behind "eaten" error reporting.

    It helps a log when looking for bugs or places that might become bugs.
  • Another cause of blank pages can be your server deciding to serve index.htm or index.html from the PostNuke folder before it serves index.php. If you happen to have an empy file named index.htm or index.html, your server may be configured to serve that page if it exists. Put some content in it to see if that is the case. You can remove it or you can edit your .htaccess file by adding DirectoryIndex index.php. If there is already a DirectoryIndex directive, change it.
  • Also be sure to set the theme to ExtraLite to troubleshoot blank pages with the errors turned on as well.
    I had an AutoTheme as default, and it was hiding the errors as well after making the above changes.

    Changed to Extralite and WHAM! found out I had a duplicate of a block. :)

    --
    Zikula Themes
  • What can be done if those above hints are followed (full error reporting activated, theme changed to ExtraLite) and blank pages are still appearing with no error at all dumped to the browser? :(
  • I finally found a solution. The problem was with a language file. So, don't you just think that if there's a problem with some language variable you'll always get an error!

    If everything else fails, and you got a multilingual site try changing language. If the Blank Page is not blank when you change language, then it's a problem with some language file associated with that page. Hope this helps.
  • I tried this tutorial and no error is being displayed. I would like to know if there is another method to have them display in Postnuke such as the already outdated post above suggested with pnAPI.php

    What file has this functionality in current 0762 release so that I could enable error reporting?

    By the way, I just upgraded and am unable to get to user.php and cannot log out either. In both situations I get a Blank Page. For logout I tried links

    /user.php?module=NS-User&op=logout

    and

    /user.php?module=User&op=logout

    I am so close to getting the upgrade done, please help :)
  • Alright, I realized there is no support in this forum, I didn't see the message at the forum index since I got to this thread through another link. I didn get m problems resolved however, in a very mysterious way everything resolved itself without me doing anything.

    I still think that there should be an update on the above posting regarding pnAPI.php (lack of it) and how to turn on errors in postnuke.

    --
    "A patriot must be ready to defend his country against his government." - Edward Abbey
  • Just wanting to add my 2 cents.

    I came across this error today and after a lot of poking around, discovered that most of the other pages worked, such as admin.php and user.php, but not index.php.

    the problem was, index.php would run PHP out of the default 8M of memory. So to fix i upped it to 16M and now she runs great!
  • jadranko

    I still think that there should be an update on the above posting regarding pnAPI.php (lack of it) and how to turn on errors in postnuke.


    ? What do you mean lack of it? pnAPI is still there, includes/pnAPI.php and it still has the error reporting code, tho I think the error reporting code should be a toggle in config.php.
  • If I had any hair left, I'd be pulling it out icon_wink I have tried all of the above, and still can't get any errors to show. Swiss Army Knife runs and I can read the site info. My theme is set to Extra Lite. I've enabled the error reporting in both .ini files and /pnAPI.php and still just blank pages. To make matters worse, I'm kinda a noob with Linux too. Running SuSE 10.1, MySQL 5.0.18, Postnuke 0.762.
  • I tried everything to and nothing seemed to work. I did find a solution that worked for me though not sure why or how it worked but it did. Once i went to extralite theme i opened up the webpage in internet explorer and still got Blank Page. So just for the heck of it I opened it up in Firefox and it actually let me create a new block without giving me a Blank Page.


This list is based on the users active over the last 60 minutes.