Able2know mod rewrite and Gun-Zip problem

Discussions about the phpBB2 Forum. How to get the best from this powerful script.

Moderator: Moderators

Able2know mod rewrite and Gun-Zip problem

Postby lavinya » Fri Sep 08, 2006 8:32 am

hello all.

I can see certain dates above error :(

Image

I'm using able2know mod_rewrite and seo,
enabled gzip forum admin,
and my php info : lavinya.net /phpinfo.php


please help me.. :roll:


--
EDİT:
Only mozilla and firefox I See error.
User avatar
lavinya
PR1
PR1
 
Posts: 167
Joined: Mon Jul 24, 2006 9:05 am
Location: Turkey

Advertisement

Postby dcz » Fri Sep 08, 2006 8:55 am

Well it seems it's only the Gziped buffer to be sent without the Content-Encoding header.
These are the kind of things happening when using ob_start ;)

I suggest you check you includes/page_header.php and page_tail.php, around :
Code: Select all
if ( $board_config['gzip_compress'] )


for header and

Code: Select all
if ( $do_gzip_compress )


for tail, and check if you have the correct 2.0.21 code here.
But I am pretty sure the Gzip handling was modified by the able2know mod rewrite, so it's not necessarily going to be easy to fix that.

Anyway, with Gun-zip, it's only a matter of resources (will take more) vs bandwidth (will need less), meaning you can leav without.

Maybe the simplest method to fix this will be to migrate to one of the phpBB SEO mod rewrites ;)


++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21393
Joined: Fri Apr 28, 2006 9:03 pm

Postby lavinya » Fri Sep 08, 2006 9:12 am

hımm :?

big thanks dcz.

I'm using phpBB 2.0.21 .

Code: Select all
if ( $do_gzip_compress )
already added. BUT mixed AND arduous :(

dcz please see my files check please :oops:
www.lavinya.net/2.zip (page_header and page_tail)
User avatar
lavinya
PR1
PR1
 
Posts: 167
Joined: Mon Jul 24, 2006 9:05 am
Location: Turkey

Postby lavinya » Fri Sep 08, 2006 9:19 am

sorry dcz. small english :(

using seslisozluk.com
User avatar
lavinya
PR1
PR1
 
Posts: 167
Joined: Mon Jul 24, 2006 9:05 am
Location: Turkey

Postby dcz » Fri Sep 08, 2006 9:24 am

So it seems Gun-zip never was available with the abl2know mod rewrite as it's code :

Code: Select all
if ( !$userdata['session_logged_in'] )
{
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);
global $dbg_starttime;
}


is destroying the buffer (ob_end_clean(); ) before it is eventually sent Gunzipped.

You can try :

Open :
Code: Select all
includes/page_tail.php


Find :

Code: Select all
if ( !$userdata['session_logged_in'] )
{
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);
global $dbg_starttime;
}

//
// Compress buffered output if required and send to browser
//
if ( $do_gzip_compress )
{
   //
   // Borrowed from php.net!
   //
   $gzip_contents = ob_get_contents();
   ob_end_clean();

   $gzip_size = strlen($gzip_contents);
   $gzip_crc = crc32($gzip_contents);

   $gzip_contents = gzcompress($gzip_contents, 9);
   $gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);

   echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
   echo $gzip_contents;
   echo pack('V', $gzip_crc);
   echo pack('V', $gzip_size);
}


Replace with :

Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if( function_exists(ob_gzhandler) && $board_config['gzip_compress'] == 1)
{
   if ( !$userdata['session_logged_in'] )
   {
      $gzip_contents = replace_for_mod_rewrite(ob_get_contents());
   }
   else
   {
      $gzip_contents = ob_get_contents();
   }
   ob_end_clean();
   ob_start('ob_gzhandler');
   echo $gzip_contents;
   ob_end_flush();
}
else
{
   $contents = ob_get_contents();
   ob_end_clean();
   echo $contents;
   global $dbg_starttime;
}
// www.phpBB-SEO.com SEO TOOLKIT END


I cannot test, as I do not run the able2know mod rewrite, but it should solve your issue ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21393
Joined: Fri Apr 28, 2006 9:03 pm

Postby dcz » Fri Sep 08, 2006 9:25 am

lavinya wrote:sorry dcz. small english :(

using seslisozluk.com


Lol, don't worry, you'll imporve :D Something like an SEO side effect :lol:

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21393
Joined: Fri Apr 28, 2006 9:03 pm

Postby lavinya » Fri Sep 08, 2006 10:00 am

:lol: vavv

thanks dcz. you excellent.

now trying below code :)
User avatar
lavinya
PR1
PR1
 
Posts: 167
Joined: Mon Jul 24, 2006 9:05 am
Location: Turkey

Postby lavinya » Fri Sep 08, 2006 10:08 am

dcz error direct page :((

click to www.lavinya.net/phpBB2/

Image

now delete below code I back to old code :(
User avatar
lavinya
PR1
PR1
 
Posts: 167
Joined: Mon Jul 24, 2006 9:05 am
Location: Turkey

Postby dcz » Fri Sep 08, 2006 10:15 am

Sorry I forgot to mention you should as well delete this from page_header.php :

Code: Select all
//
// gzip_compression
//
$do_gzip_compress = FALSE;
if ( $board_config['gzip_compress'] )
{
   $phpver = phpversion();

   $useragent = (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) ? $HTTP_SERVER_VARS['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT');

   if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) )
   {
      if ( extension_loaded('zlib') )
      {
         ob_start('ob_gzhandler');
      }
   }
   else if ( $phpver > '4.0' )
   {
      if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )
      {
         if ( extension_loaded('zlib') )
         {
            $do_gzip_compress = TRUE;
            ob_start();
            ob_implicit_flush(0);

            header('Content-Encoding: gzip');
         }
      }
   }
}


And find :


Code: Select all
if ( !$userdata['session_logged_in'] )
{
ob_start();


and replace with :

Code: Select all
ob_start();
if ( !$userdata['session_logged_in'] )
{


as we are now handling Gun-zip through ob_gzhandler which does all the header sending and such.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21393
Joined: Fri Apr 28, 2006 9:03 pm

Postby lavinya » Fri Sep 08, 2006 11:23 am

thanks for reply :)

dcz I added below all code
forum is working.

but I surfing my forum
certain times topic or post click this error:
Image
User avatar
lavinya
PR1
PR1
 
Posts: 167
Joined: Mon Jul 24, 2006 9:05 am
Location: Turkey

Postby dcz » Fri Sep 08, 2006 11:27 am

Must be your server having trouble with gun-zip and ob_start then. It's very common.

I think you have no choice but to turn it off and go back to original code then, or give a try to the phpBB SEO method, since you can migrate with no trouble if we setup the correct redirections.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21393
Joined: Fri Apr 28, 2006 9:03 pm

Postby lavinya » Fri Sep 08, 2006 12:34 pm

OK. thanks dcz for quickly your reply messages :)


can you look at this http://www.phpbb.com/phpBB/viewtopic.ph ... 466#257466

he solved that problem at this link.
User avatar
lavinya
PR1
PR1
 
Posts: 167
Joined: Mon Jul 24, 2006 9:05 am
Location: Turkey

Postby dcz » Fri Sep 08, 2006 12:46 pm

That's the problem with ob_start(), if a mod adds other things in the buffer and such. With what I suggested there should not be any more issues, but who knows.

Anyway, the regular phpbb ob_implicit_flush was already taken out in the code changes I sent, so beside migrating ...

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21393
Joined: Fri Apr 28, 2006 9:03 pm

Postby lavinya » Sat Sep 09, 2006 8:19 am

thanks dcz .
User avatar
lavinya
PR1
PR1
 
Posts: 167
Joined: Mon Jul 24, 2006 9:05 am
Location: Turkey


Return to phpBB2 Forum

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest