dssu33392 2018-04-26 10:21
浏览 102

ob_start(“ob_gzhandler”)给出了错误

I am using ob_start("ob_gzhandler") to gzip the response that I am sending from my API. It is working fine on my developer machine as well as on staging environment.

However, when I deployed my API in a production environment it is giving me an error that server is not responding.

I think there is some extension to be enabled for using gzip compression. Can you please help me in the resolution of the issue.

  • 写回答

1条回答 默认 最新

  • douxia6554 2018-04-26 10:28
    关注

    From php docs:

    Note:

    ob_gzhandler() requires the zlib extension.

    Install the zlib extension. You can check if the extension is installed by executing the following code:

    if (extension_loaded('zlib')){
        echo "zlib installed";
    } else {
        echo "zlib is not installed";
    }
    
    评论

报告相同问题?