Re: interesting problem with zlib/ob_gzhandler compression
| From: | Christian Calloway | Date: | Thu, 22 Jul 2004 14:34:46 +0000 |
| Subject: | Re: interesting problem with zlib/ob_gzhandler compression | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191560@lists.php.net to get a copy of this message | ||
Well 3 hours later I have a solution.. I turned off output_compression using
the ini_set function, within the scripts dynamically generating javascript
variables. This wasn't possible earlier, as I think there was a bug that
didn't allow me to use ini_set on the zlib.output_compression directive.
"Christian Calloway" <callowaylc@yahoo.com> wrote in message
news:20040722180747.94650.qmail@pb1.pair.com...
> I have ran into a rather interesting problem while zlib or gzip
compression
> is enabled on my site. I have an external javascript-php file (a
javascript
> file that is dynamically generated as in filename.js.php) which is
included
> in the main template using the <script> element (for example <script
> src="filename.js.php"></script>). This file defines variables that are
used
> to populate a javascript drop-down menu. With compression turned on, from
> time-to-time, I get a javascript error basically saying that certain
> variables have not been defined. At other times it works perfectly; this
> phenomenom appears to be completely random. My theory is, with compression
> turned on (via php.ini), the external php file does not get placed into
the
> output buffer until some point in time after the currently executing
script
> has been compressed. The reason being, is that the file is not included
into
> the script using a php "require" construct, but rather via HTML's <script>
> element. I have played with this forever, and I have not found a solution.
> Has anyone else ran into this problem; any suggetions or comments are
> greatly welcomed. Thanks in advance,
>
> Christian