This article mainly introduces PHP in the Apache environment to implement the Gzip configuration method, a more detailed analysis of the relevant configuration file modification skills, very practical value, the need for friends can refer to the next
The example in this paper describes how PHP implements gzip configuration in Apache environment. Specific as follows:
1, conf/httpd.conf
1) Remove #loadmodule headers_module modules/mod_headers.so in front of the note #,
2) Add LoadModule deflate_module modules/mod_deflate.so,
3) Remove the comment # in front of # include conf/extra/httpd-vhosts.conf.
2, conf/extra/httpd-vhosts.conf in the VirtualHost add
<location "/" > Setoutputfilter DEFLATE browsermatch ^mozilla/4 gzip-only-text/html browsermatch ^Mozilla/4\.0[ 678] No-gzip browsermatch \bmsie!no-gzip!gzip-only-text/html setenvifnocase request_uri \. (?: gif|jpe?g|png) $ no-gzip dont-vary Header append vary user-agent env=!dont-vary</location>
For example:
<virtualhost *:80> documentroot "d:/apache2.2/htdocs/wef" <location "/" > setoutputfilter DEFLATE browsermatch ^MOZILLA/4 gzip-only-text/html Browsermatch ^mozilla/4\.0[678] no-gzip browsermatch \bmsie!no-gzip!gzip-only-text/html SetEnvIfNoCase Request_uri \. (?: gif|jpe?g|png) $ no-gzip dont-vary Header append vary user-agent env=!dont-vary </location></ Virtualhost>
Summary : The above is the entire content of this article, I hope to be able to help you learn.
Related recommendations:
Php method for FTP transfer of files based on Curl
PHP read-write operations for databases and random number operations
PHP simulation QQ login based on Curl operation