Home >Backend Development >PHP Tutorial >Configuration method to enable gzip page compression output in php
This article introduces how to enable gzip page compression output in PHP for your reference.
Points about configuring gzip compression in php: 1. By default, PHP does not enable zlib whole-site compression output, but uses the ob_gzhandler function for pages that require compressed output. You can only choose one of the two, otherwise an error will be reported. 2. The default value of zlib.output_compression is Off, you can set it to On, or output buffer size (default is 4k) 3. zlib.output_compression_level represents the compression ratio. The default recommended compression ratio is 6. The optional range is 1-9. -1 means turning off php zlib (gzip) compression |