Home  >  Article  >  Backend Development  >  Configuration method to enable gzip page compression output in php

Configuration method to enable gzip page compression output in php

WBOY
WBOYOriginal
2016-07-25 08:58:56983browse
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



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn