Meta Matters

Comments and discussion of (mostly) Joomla-related topics by the author of MetaMod and Chameleon.

Sep 27
2010

PHP setting for output_handler = ob_gzhandler breaks Joomla

Posted by: metamodguy

Tagged in: PHPhosting

PHP logoA couple of days ago, out of the blue people started complaining that they couldn’t download updates of MetaMod Pro and MetaTemplate Pro from this site. After quite a lot of searching I found that the hosting company has added a new PHP default parameter to the server, which was breaking lots of things...

output_handler = ob_gzhandler

While that might have seemed like a good idea, there are some elements of core Joomla and a number of 3rd party extensions that just simply break if PHP’s gzhandler is enabled by default.

You can see if this is the case on your Joomla site by going to the Help -> System Info page and clicking on the “PHP Information” tab. The main indicator is the output_handler value which I found was suddenly set to “ob_gzhandler”.

The best solution would be if my host would acknowledge that they did it, and revert it... but until that happens (!!) I've had to revert to another way of fixing it.

Since PHP is running as a CGI on this host (much more secure), it unfortunately means that there’s no central place for me to put php.ini options. I have to place a php.ini file in every directory where there are PHP scripts that get run “directly”.

I was having trouble with VirtueMart, Myblog, my template, and eXtplorer. So I have had to create php.ini files in the following locations (relative to site root):

./php.ini
./templates/yoo_nu/lib/js/php.ini
./templates/yoo_nu/css/php.ini
./plugins/editors/jce/tiny_mce/php.ini
./plugins/editors/tinymce/jscripts/tiny_mce/php.ini
./components/com_virtuemart/php.ini
./administrator/php.ini
./administrator/components/com_extplorer/php.ini

The contents of the php.ini file are:

output_buffering = Off
output_handler =
zlib.output_compression = Off

Obviously, this is a real pain, and there’s every chance that any new extension that I add may not work unless I splat php.ini files around inside it.

In any case, I hope that this helps anyone else caught out in the same situation.


blog comments powered by Disqus