PHP implementation of GZIP configuration method in Apache environment, apachegzip_php tutorial

Source: Internet
Author: User
Tags php programming

PHP implements gzip configuration method in Apache environment, Apachegzip


The example in this paper describes how PHP implements gzip configuration in Apache environment. Share to everyone for your reference. 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
Add in VirtualHost

 
  
   
   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
 
  

For example:

 
  
   
   DocumentRoot "d:/apache2.2/htdocs/wef" 
  
   
    
     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 
  
   
 
  

I hope this article is helpful to everyone's PHP programming.

http://www.bkjia.com/PHPjc/978384.html www.bkjia.com true http://www.bkjia.com/PHPjc/978384.html techarticle PHP in the Apache environment to implement the Gzip configuration method, Apachegzip This example of PHP in the Apache environment to implement the Gzip configuration method. Share to everyone for your reference. Specific as follows: 1, con ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.