Enable GZip Compression On Bluehost

In a day where web browsers are becoming the cornerstone of modern computing capable of incredible animations and driven by the most advanced technologies, we need to do our part to make the web faster. Analogous to “zipping” local files to save storage, GZip aims to make the web faster by serving compressed pages and thereby saving bandwidth on both ends at the cost of server CPU time (although this is often negligible). Read more about GZip here

Before starting off, verify that your site is not serving GZipped pages here: https://checkgzipcompression.com/.

  1. Login to your Bluehost account CPanel.
  2. Navigate down to the Software/Services section and click on PHP Config. Select “PHP 5.4 (FastCGI)” and hit save. Then go back to the main CPanel menu. (Note: PHP 5.4 is compatible with most things at this point, but this method will work with PHP 5.2 FastCGI as well.)bh-cpanel-php
  3. Navigate to the File Management section and click File Manager. Check “Web Root” and “Show Hidden Files (dotfiles)” and hit go.bh-cpanel-php-filemgmt
  4. On the editor page, scroll down till you find “php.ini” Highlight it and click Edit at the top.bh-cpanel-editor
  5. Search the file (ctrl+f on Windows, command+f on a Mac) for “zlib.output_compression” and look for the following instance: bh-gzip-zlib
  6. Change “Off” to “On” and hit Save Changes in the top right of the editor.
  7. Go back to the main CPanel. Scroll down to the same place as you did in Step 2 (see above) except this time click Process Manager. Once there, Force Kill all the processes you see (this essentially will reboot your PHP instance). Now visit your site using any browser. You should now have GZip compression enabled.

Drop me a line if this walkthrough worked for you and/or you run into issues! These instructions should be applicable to most shared hosts (especially if they use CPanel backends).

Legal

My posts are not to serve as a replacement for recommendations provided by licensed physicians nor do they represent the opinions of Baylor College of Medicine or its affiliated institutions. Please read this site's Disclaimer and Terms of Use for more information.

Comments

  • http://www.springboardseo.com/ Springboard SEO

    Helpful post! Unfortunately, it seems that only the html files themselves are being compressed, but not JS.

    • http://rk.md/ Rishi

      Right – I’d recommend you use this in tandem with Cloudflare’s service. =)

      • http://www.springboardseo.com/ Springboard SEO

        Sounds good. I decided to let Google host my jQuery at least, and I’m assuming they gzip it. Do you suggest I let Cloudfare host my jQuery too? One source I read noted they were faster than Google’s CDN. Thanks for the post though, it got me over the first, mysterious part of gzipiness.

        • http://rk.md/ Rishi

          Anytime buddy! Yeah, I’ve gone with Cloudflare’s repository (CDNJS) since it’s more comprehensive. Make sure you use the “.min.js” version of JQuery to save more bandwidth.

      • http://www.springboardseo.com/ Springboard SEO

        Page load times have dropped drastically, with the free Cloudfare plan, to boot. Unreal! Thanks!

  • N

    Thanks, works like a charm!!

    • http://rk.md/ Rishi

      No problem! I’m glad it helped!

  • eric

    Thank you for your share,but gzip still not enabled,I have try many times,but not work…

    • http://rk.md/ Rishi

      What’s your domain name? Are you sure you’ve reset your PHP process?

  • http://circlecitybicycles.com Ed Pope

    I ran through this & I think he did everything, including the Force Kill, but when I check it, it still says I’m not using gzip. My website is http://pinewideplankflooring.net – Any ideas on what’s wrong?

  • Marco

    Thanks so much!

  • Osmyn

    Thank you!!! Worked just like you said. Instructions were very easy to follow. Thanks again!