Revision history for BlankPageWorkaround


Revision [18363]

Last edited on 2008-01-28 00:11:13 by JavaWoman [Modified links pointing to docs server]

No Differences

Revision [7641]

Edited on 2005-04-26 13:00:33 by JavaWoman [minor (layout)]
Additions:
~- edit ##/css/wikka.css##
~- change this to: %%(css)height: auto;%% ---
//The stylesheet will be fixed in the next version of Wikka (probably 1.1.6.1)//
Deletions:
~- edit /css/wikka.css
~- change this to: %%(css)height: auto;%%
//This will be fixed in the next version of Wikka (probably 1.1.6.1)//


Revision [7640]

Edited on 2005-04-26 12:53:22 by JavaWoman [adding stylesheet tweak]
Additions:
=====Only blank pages=====

===Symptoms===
In a newly-installed system (or one previously installed but migrated to a new host) accessing **any page** (including the home page and other pages that are known to exist) results in nothing but a blank page in the browser.

===Cause===
==Analysis==
Check if the host that Wikka is installed on is inserting banners in your pages. The way to check is to install a plain HTML page (so Wikka can be avoided). Many free (and some very cheap) hosts insert a banner. If your host does indeed insert a banner, the workaround below can provide a solution.

==Technical explanation==
When a (free) host inserts a banner, it interferes with two things Wikka does by default:
~-when Gzip-encoding is active, inserting a banner just messes things up (causing the **blank page**); and
~-Wikka calculates content-length for a HTTP header - which will be incorrect after the banner is inserted, so you would see a truncated page when Gzip is not active.

===Applies to===
Any Wikka version.

===Solution===
A new configuration value and a small change in the code can provide a workaround for banner insertion causing **blank pages** or **truncated pages**.

==Configuration==
First, open **##/wikka.config.php##** (after allowing write access on it!) and find the line %%(php) "wikiping_server" => "",%% (or possibly there's a value after the **##=>##**) and add the following line right after it: %%(php) "banner_insert" => "1",%% to indicate your host inserts banners in your Wikka's output. (Make the file read-only again after editing it).

==Main program==
Then open **##/wikka.php##** and find this code at the end: %%(php)$content = ob_get_contents();
if (strstr ($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') )
{
// Tell the browser the content is compressed with gzip
header ("Content-Encoding: gzip");
$page_output = gzencode($content);
$page_length = strlen($page_output);
} else {
$page_output = $content;
$page_length = strlen($page_output);
}

// header("Cache-Control: pre-check=0");
header("Cache-Control: no-cache");
// header("Pragma: ");
// header("Expires: ");

$etag = md5($content);
header('ETag: '.$etag);

header('Content-Length: '.$page_length);
ob_end_clean();
echo $page_output;%% and change it as follows: %%(php)$content = ob_get_contents();
// if host inserts banner but supports gzip we prevent gzip encoding by setting 'banner_insert' to '1' in the configuration
if (strstr ($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') && $wakka->config['banner_insert'] == '0')
{
// Tell the browser the content is compressed with gzip
header ("Content-Encoding: gzip");
$page_output = gzencode($content);
header('Content-Length: '.strlen($page_output));
} else {
$page_output = $content;
// if host inserts banner we don't want content-length calculation to prevent page truncation in the browser
if ($wakka->config['banner_insert'] == '0')
{
header('Content-Length: '.strlen($page_output));
}
}

// header("Cache-Control: pre-check=0");
header("Cache-Control: no-cache");
// header("Pragma: ");
// header("Expires: ");

$etag = md5($content);
header('ETag: '.$etag);

//header('Content-Length: '.$page_length); # moved
ob_end_clean();
echo $page_output;%%

==Other host?==
If you later move the site to another host that doesn't insert banners, just change the config to set 'banner_insert' to '0' and you'll get gzip encoding enabled again, as well as content-length calculation. Using Gzip encoding costs a little extra in CPU but saves on bandwidth.

===Refinement===
Even if after the workaround outlined here you no longer have blank or truncated pages, some pages may still not display properly, depending on content and on the browser used. //If you use Internet Explorer you may not see this but people using a more standards-compliant browser like Firefox may see the page content overlapping the page footer.// This can be fixed (at least in most cases) with a small tweak to the default stylesheet:
~- edit /css/wikka.css
~- find the entry for ##.page##
~- at the end this has the rule: %%(css)height: 100%;%% ---
~- change this to: %%(css)height: auto;%%
//This will be fixed in the next version of Wikka (probably 1.1.6.1)//

----
Deletions:
=====Only blank pages=====

===Symptoms===
In a newly-installed system (or one previously installed but migrated to a new host) accessing **any page** (including the home page and other pages that are known to exist) results in nothing but a blank page in the browser.

===Cause===
==Analysis==
Check if the host that Wikka is installed on is inserting banners in your pages. The way to check is to install plain HTML page (so Wikka can be avoided). Many free (and some very cheap) hosts insert a banner. If your host does indeed insert a banner, the workaround below can provide a solution.

==Technical explanation==
When a (free) host inserts a banner, it interferes with two things Wikka does by default:
~-when Gzip-encoding is active, inserting a banner just messes things up (causing the **blank page**); and
~-Wikka calculates content-length for a HTTP header - which will be incorrect after the banner is inserted, so you would see a truncated page when Gzip is not active.

===Applies to===
Any Wikka version.

===Solution===
A new configuration value and a small change in the code can provide a workaround for banner insertion causing **blank pages** or **truncated pages**.

==Configuration==
First, open **##/wikka.config.php##** (after allowing write access on it!) and find the line %%(php) "wikiping_server" => "",%% (or possibly there's a value after the **##=>##**) and add the following line right after it: %%(php) "banner_insert" => "1",%% to indicate your host inserts banners in your Wikka's output. (Make the file read-only again after editing it).

==Main program==
Then open **##/wikka.php##** and find this code at the end: %%(php)$content = ob_get_contents();
if (strstr ($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') )
{
// Tell the browser the content is compressed with gzip
header ("Content-Encoding: gzip");
$page_output = gzencode($content);
$page_length = strlen($page_output);
} else {
$page_output = $content;
$page_length = strlen($page_output);
}

// header("Cache-Control: pre-check=0");
header("Cache-Control: no-cache");
// header("Pragma: ");
// header("Expires: ");

$etag = md5($content);
header('ETag: '.$etag);

header('Content-Length: '.$page_length);
ob_end_clean();
echo $page_output;%% and change it as follows: %%(php)$content = ob_get_contents();
// if host inserts banner but supports gzip we prevent gzip encoding by setting 'banner_insert' to '1' in the configuration
if (strstr ($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') && $wakka->config['banner_insert'] == '0')
{
// Tell the browser the content is compressed with gzip
header ("Content-Encoding: gzip");
$page_output = gzencode($content);
header('Content-Length: '.strlen($page_output));
} else {
$page_output = $content;
// if host inserts banner we don't want content-length calculation to prevent page truncation in the browser
if ($wakka->config['banner_insert'] == '0')
{
header('Content-Length: '.strlen($page_output));
}
}

// header("Cache-Control: pre-check=0");
header("Cache-Control: no-cache");
// header("Pragma: ");
// header("Expires: ");

$etag = md5($content);
header('ETag: '.$etag);

//header('Content-Length: '.$page_length); # moved
ob_end_clean();
echo $page_output;%%

==Other host?==
If you later move the site to another host that doesn't insert banners, just change the config to set 'banner_insert' to '0' and you'll get gzip encoding enabled again, as well as content-length calculation. Using Gzip encoding costs a little extra in CPU but saves on bandwidth.

----


Revision [5241]

Edited on 2005-01-26 20:42:41 by JavaWoman [adding new section]
Additions:
===Applies to===
Any Wikka version.


Revision [4999]

Edited on 2005-01-23 12:25:40 by JavaWoman [minor]
Additions:
~-when Gzip-encoding is active, inserting a banner just messes things up (causing the **blank page**); and
Deletions:
~-when Gzip-encoding is active, inserting a banner just messes things up (causing the blank page); and


Revision [4993]

Edited on 2005-01-23 12:13:03 by JavaWoman [filling in Solution section]
Additions:
Check if the host that Wikka is installed on is inserting banners in your pages. The way to check is to install plain HTML page (so Wikka can be avoided). Many free (and some very cheap) hosts insert a banner. If your host does indeed insert a banner, the workaround below can provide a solution.
===Solution===
A new configuration value and a small change in the code can provide a workaround for banner insertion causing **blank pages** or **truncated pages**.
==Configuration==
First, open **##/wikka.config.php##** (after allowing write access on it!) and find the line %%(php) "wikiping_server" => "",%% (or possibly there's a value after the **##=>##**) and add the following line right after it: %%(php) "banner_insert" => "1",%% to indicate your host inserts banners in your Wikka's output. (Make the file read-only again after editing it).
==Main program==
Then open **##/wikka.php##** and find this code at the end: %%(php)$content = ob_get_contents();
if (strstr ($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') )
{
// Tell the browser the content is compressed with gzip
header ("Content-Encoding: gzip");
$page_output = gzencode($content);
$page_length = strlen($page_output);
} else {
$page_output = $content;
$page_length = strlen($page_output);
}
// header("Cache-Control: pre-check=0");
header("Cache-Control: no-cache");
// header("Pragma: ");
// header("Expires: ");
$etag = md5($content);
header('ETag: '.$etag);
header('Content-Length: '.$page_length);
ob_end_clean();
echo $page_output;%% and change it as follows: %%(php)$content = ob_get_contents();
// if host inserts banner but supports gzip we prevent gzip encoding by setting 'banner_insert' to '1' in the configuration
if (strstr ($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') && $wakka->config['banner_insert'] == '0')
{
// Tell the browser the content is compressed with gzip
header ("Content-Encoding: gzip");
$page_output = gzencode($content);
header('Content-Length: '.strlen($page_output));
} else {
$page_output = $content;
// if host inserts banner we don't want content-length calculation to prevent page truncation in the browser
if ($wakka->config['banner_insert'] == '0')
{
header('Content-Length: '.strlen($page_output));
}
}
// header("Cache-Control: pre-check=0");
header("Cache-Control: no-cache");
// header("Pragma: ");
// header("Expires: ");
$etag = md5($content);
header('ETag: '.$etag);
//header('Content-Length: '.$page_length); # moved
ob_end_clean();
echo $page_output;%%
==Other host?==
If you later move the site to another host that doesn't insert banners, just change the config to set 'banner_insert' to '0' and you'll get gzip encoding enabled again, as well as content-length calculation. Using Gzip encoding costs a little extra in CPU but saves on bandwidth.
Deletions:
Check if the host that Wikka is installed on is inserting banners in your pages. The way to check is to install plain HTML page (so Wikak can be avoided). Many free (and some very cheap) hosts insert a banner. If your host does indeed insert a banner, the workaround below can provide a solution.
===Workaround or Patch===
//later//


Revision [4992]

Edited on 2005-01-23 12:05:00 by JavaWoman [adding Cause section]
Additions:
==Analysis==
Check if the host that Wikka is installed on is inserting banners in your pages. The way to check is to install plain HTML page (so Wikak can be avoided). Many free (and some very cheap) hosts insert a banner. If your host does indeed insert a banner, the workaround below can provide a solution.
==Technical explanation==
When a (free) host inserts a banner, it interferes with two things Wikka does by default:
~-when Gzip-encoding is active, inserting a banner just messes things up (causing the blank page); and
~-Wikka calculates content-length for a HTTP header - which will be incorrect after the banner is inserted, so you would see a truncated page when Gzip is not active.


Revision [4991]

Edited on 2005-01-23 11:55:09 by JavaWoman [problem description]
Additions:
In a newly-installed system (or one previously installed but migrated to a new host) accessing **any page** (including the home page and other pages that are known to exist) results in nothing but a blank page in the browser.
//later//
//later//
Deletions:
In a newly-installed system (or one previously installed but migrated to a new host) accessing any **existing** page results in nothing but a blank page in the browser.


Revision [4986]

Edited on 2005-01-23 11:44:30 by JavaWoman [stub]
Additions:
=====Only blank pages=====
In a newly-installed system (or one previously installed but migrated to a new host) accessing any **existing** page results in nothing but a blank page in the browser.
Deletions:
=====Problem description=====
//This page is a **template** intended for documentation of **workarounds** for unusual Wikka problems. This page belongs to CategoryTemplate (which contains more handy templates). To create a Wikka **workaround** page, [[http://wikka.jsnx.com/WorkaroundTemplate/clone clone this page]] (most workaround page names end in 'Workaround' so it's useful to stick to that convention) and replace the title with a problem description. Then remove this paragraph and provide actual page content in the outline below.//


Revision [4985]

The oldest known version of this page was created on 2005-01-23 11:41:38 by JavaWoman [stub]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki