Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

invalid form of compression php

Content Encoding Error

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

there are folders of smarty templates

i am using a cms
<?php
define('_VALID', true);
require 'include/config.php';
require 'include/function_global.php';
require 'include/function_smarty.php';


$sql_add	= NULL;
$sql_delim	= ' WHERE';
if ( $config['show_private_videos'] == '0' ) {
    $sql_add   .= $sql_delim. " type = 'public'";
    $sql_delim	= ' AND';
}

$sql_add       .= $sql_delim. " active = '1'";  

$sql            = "SELECT VID, title, duration, addtime, thumb, viewnumber, rate, type
                   FROM video" .$sql_add. " ORDER BY viewtime DESC LIMIT " .$config['watched_per_page'];
$rs             = $conn->execute($sql);
$viewed_videos  = $rs->getrows();
$viewed_total   = count($viewed_videos);
$sql            = "SELECT VID, title, duration, addtime, thumb, viewnumber, rate, type
                   FROM video" .$sql_add. " ORDER BY addtime DESC LIMIT " .$config['recent_per_page'];
$rs             = $conn->execute($sql);
$recent_videos  = $rs->getrows();

$smarty->assign('errors',$errors);
$smarty->assign('messages',$messages);
$smarty->assign('menu', 'home');
$smarty->assign('index', true);
$smarty->assign('viewed_total', $viewed_total);
$smarty->assign('viewed_videos', $viewed_videos);
$smarty->assign('recent_videos', $recent_videos);
$smarty->assign('self_title', $seo['index_title']);
$smarty->assign('self_description', $seo['index_desc']);
$smarty->assign('self_keywords', $seo['index_keywords']);
$smarty->display('header.tpl');
$smarty->display('errors.tpl');
$smarty->display('messages.tpl');
$smarty->display('index.tpl');
$smarty->display('footer.tpl');
$smarty->gzip_encode();
?>

Open in new window

Avatar of SimonJ621
SimonJ621

Try clearing your cache.
hi,

The code is using gzip compression. ( see last line $smarty->gzip_encode();)

Disable the Gzip compression and your pages will work.
See if there is setting in your admin control panel to disable Gzip compression.


Thanks
I mean to say your website admin section.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Insoftservice inso
Insoftservice inso
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192

ASKER

<?php ob_start("ob_gzhandler"); ?>

3) The end_gzip.php file:

<?php ob_flush(); ?>


should i place this in php file

how could i disable gzip just to test if my file is running


i am using a cms (content managment system)
could some files be zipped
and i have to unzip them to read


Avatar of rgb192

ASKER

also
do i have to make changes in htaccess file


i may not be able to make htaccess file changes

i dont think i have access to htaccess
Hi,

You are getting the error because Gzip compression is applied. The code given by "insoftservice:" is to apply gzip compression. This would not help you out

Instead you have to remove/disable the gzip compression to get your site working.

For this: Please login to your website admin section (Admin section of your CMS) and search for the setting where you can disable the Gzip compression.

If you are not able to locate the settings in admin section; then search for the two lines of code
<?php ob_start("ob_gzhandler"); ?>
and
<?php ob_flush(); ?>
and comment these out.

But this is not the right way; if you can find the setting in administration section; it would automatically do the job for you.

Thanks


Thanks
Avatar of rgb192

ASKER

are there some files that need to be UN-GZIPED to be displayed on a browser

is there a setting in php.ini that UN-GZIPS a file
Hi,

Nope. Gzip compresses your files on the fly (before transferring the data to browser over Http). The browser that supports Gzip encoded data can decode those contents and renders it.

If the browser does not support Gzip encoding it throws an error; invalid form of compression.

I think your question is resolved?

Thanks

Avatar of rgb192

ASKER

thanks