0

I am using PHP addressbook for an web application with some additional features. Everything works fine when I tested it in my local machine using Xampp but when I hosted it in a online webserver it throws the following error message:

[ref.outcontrol]: output handler 'ob_gzhandler' cannot be used twice in .../dbconnect.php on line 27

... and the page is not showing anything its just an empty page.

if(   ini_get('zlib.output_compression') != 1
   && isset($compression_level) 
   && $compression_level > 0) {
  ini_set('zlib.output_compression_level', $compression_level);
  ob_start('ob_gzhandler');
}

Please help me to solve this issue. My gzip compressor is in off.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360

2 Answers2

0

To overcome this just put a if check like this before adding it

    if (!in_array('ob_gzhandler', ob_list_handlers())) {
        ob_start('ob_gzhandler');
    } else {
        ob_start();
    }
chandresh_cool
  • 11,753
  • 3
  • 30
  • 45
0

It says:

output handler 'ob_gzhandler' cannot be used twice in .../dbconnect.php

You can not call ob_start('ob_gzhandler') more than once in your code.