How to Fix Minify Error: !FAIL: environment : PHP/server does not auto-HTTP-encode content

So you’ve setup PHP Minify and think you’re a good citizen for making your site zippier. You run the tests in min_unit_tests and all pass, except for the last one:

!FAIL: environment : PHP/server does not auto-HTTP-encode content (1 of 72 tests run so far have failed)

Well isn’t that a pickle? What this means is that your server, likely of the linux variety and likely using mod_deflate, is already compressing everything and it’s getting in the way of how Minify likes to compress the files itself. So you certainly do not want to turn off all that regular compressed goodness across the site, you just want to turn it off in a couple directories and let Minify take over compression duties.

So here’s what you do. In the “min” directory there’s already an .htaccess file. Add this to the end of it:

SetEnvIfNoCase Request_URI .* no-gzip dont-vary

Then you also need to create an .htaccess file within the min_unit_tests directory, and add the above line to that file too, otherwise your unit tests will continue to fail ;)

Still having trouble? Please post or search the Minify Google group, as I’m not sure if I can help much more on this one!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>