Error: Warning: ob_start(): output handler ‘ob_gzhandler’ conflicts with ‘zlib output compression’

In my PHP 5.4.x setup, an old project which uses ob_start() and ob_whatever() started to throw errors like Warning: ob_start(): output handler 'ob_gzhandler' conflicts with 'zlib output compression'. On my development environment, I suppress this error by disabling zlib compression on this specific vhost.

The error

Below is the full error message I get.

1
2
3
Warning: ob_start(): output handler 'ob_gzhandler' conflicts with 'zlib output compression' in /home/lysender/projects/foo/bar/index.php on line 6
 
Notice: ob_start(): failed to create buffer in /home/lysender/projects/foo/bar/index.php on line 6

After a quick research, I got a hint that disabling the zlib compression will suppress this error. Since I’m on a vhost, I can just disable this zlib compression only in this specific project. Therefore firing up vim, I added this line on my vhost definition.

1
2
3
...
    php_value zlib.output_compression off
</VirtualHost>

Then restarted apache, then the warning is gone.

1
/etc/rc.d/rc.httpd restart

I haven’t experienced this much problem when I’m using PHP 5.3.x and even the early PHP 5.4.x on my Linux distro. Maybe something has changed that made this warning cry wolf.

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s