external Integration with wordpress timeout error

Just in case anyone else stumbles upon the same problem, here is the most robust disabling I could think of, and it seems to work as expected:

        ini_set('max_execution_time', 0);
        set_time_limit(0);

        ignore_user_abort(true);

        ini_set('output_buffering', 'off');
        ini_set('zlib.output_compression', false); 
        ini_set('implicit_flush', true);
        ob_implicit_flush(true);

        while (ob_get_level()) {
            ob_end_flush();
        }
        flush();