Xerxes1 Posted January 4, 2009 Share Posted January 4, 2009 I get the following error when I include GZIP compression... Parse error: syntax error, unexpected T_DNUMBER in /home/oni/public_html/0niCMS/turbo/header.php on line 5 <?php //gzip compression $phpver = phpversion(); $useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $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’); } } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/139425-gzip-compression/ Share on other sites More sharing options...
priti Posted January 4, 2009 Share Posted January 4, 2009 i think $phpver >= ‘4.0.4pl1? is not erroneous phpversion() whill return something like this "5.2.6" you need to compare it correctly by substr the first character i.e 5 and then compare. Hope it help thanks. Quote Link to comment https://forums.phpfreaks.com/topic/139425-gzip-compression/#findComment-729356 Share on other sites More sharing options...
Xerxes1 Posted January 4, 2009 Author Share Posted January 4, 2009 Ok, I am not very good at PHP... what would the correct code be? Quote Link to comment https://forums.phpfreaks.com/topic/139425-gzip-compression/#findComment-729513 Share on other sites More sharing options...
DarkWater Posted January 4, 2009 Share Posted January 4, 2009 You are not using standard quotation marks. Are you using Microsoft Word to edit code? Quote Link to comment https://forums.phpfreaks.com/topic/139425-gzip-compression/#findComment-729518 Share on other sites More sharing options...
Xerxes1 Posted January 4, 2009 Author Share Posted January 4, 2009 You are not using standard quotation marks. Are you using Microsoft Word to edit code? lrn2compooter u say? I have changed the script to have normal ' marks instead of the other ones, however the error still occurs <?php //gzip compression $phpver = phpversion(); $useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $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'); } } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/139425-gzip-compression/#findComment-729525 Share on other sites More sharing options...
DarkWater Posted January 4, 2009 Share Posted January 4, 2009 Change those ? after the numbers to ' too.... Quote Link to comment https://forums.phpfreaks.com/topic/139425-gzip-compression/#findComment-729529 Share on other sites More sharing options...
Xerxes1 Posted January 4, 2009 Author Share Posted January 4, 2009 Ok that seems to have been fixed but now I get the same error on line 10 Quote Link to comment https://forums.phpfreaks.com/topic/139425-gzip-compression/#findComment-729563 Share on other sites More sharing options...
xtopolis Posted January 4, 2009 Share Posted January 4, 2009 Did you change all the ? -> ' Such as the one on line 9.. Quote Link to comment https://forums.phpfreaks.com/topic/139425-gzip-compression/#findComment-729565 Share on other sites More sharing options...
priti Posted January 5, 2009 Share Posted January 5, 2009 i think line 10 wuld be $phpver > '4.0? make the same changes here also :-) Quote Link to comment https://forums.phpfreaks.com/topic/139425-gzip-compression/#findComment-729778 Share on other sites More sharing options...
puertoricoautoforo Posted March 18, 2009 Share Posted March 18, 2009 cannot get GZIP to work, at least according to zen cart.. The pre-install test tells me that: PHP Output Buffering (gzip) = OFF Does anyone know what I might need to change in order to enable this? here's my phpinfo... http://www.puertoricoautoforo.com/phpinfo.php Quote Link to comment https://forums.phpfreaks.com/topic/139425-gzip-compression/#findComment-787682 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.