How to Enable gzip compression in AMPPS server

Overview

This guide will help you enable gzip compression in AMPPS. Enabling gzip compresses the output hence saving the amount of data transferred and making the results show faster.


Configure php.ini file

  • In order to configure php.ini file go to AMPPS panel click Settings button next to the php version and click Configuration button and open PHP conf file, make following changes.
  • Add zlib.output_handler=On in your php.ini file as shown below.
  • Save the php.ini file.
php

Configure httpd.conf file

  • In order to configure httpd.conf file go to AMPPS panel click Settings button next to the Apache, click Configuration button and open httpd conf file, make following changes and save the file.
  • Uncomment "mod_defalte.so" and "mod_filter.so" modules by removing # at the beginning of the line as shown below.
apache
  • Add the following block to the end of the httpd.conf file. This block specifies which directories of AMPPS should be served using the gzip compression.

<Directory "{$path}/www">

    <IfModule mod_deflate.c>

        # Add any file type you want

        AddOutputFilterByType DEFLATE text/html

        AddOutputFilterByType DEFLATE php

    </IfModule>

</Directory>

apache-1

NOTE: {$path} refers to AMPPS installation path.

  • Save the httpd.conf file and restart the Apache service from AMPPS panel.
    Was this page helpful?

    Download AMPPS

    Subscribe to our Newsletter for any and all AMPPS related news and tutorials
    By entering your email, you agree to our Terms of Service and Privacy Policy.

    Tell your Friends about AMPPS


    Newsletter Subscription
    Subscribing you to the mailing list