23673

How to check if my shared hosting provider has mod_gzip installed?

Is there a way to check if my hosting provider has mod_gzip enabled? It's not mentioned in any info on the web site, nor there is a forum to contact other people about this problem. Thanks.

Answer1:

You can check that with either PHP’s apache_get_modules or phpinfo.

If you want to compress your output, you might want to try the output buffer handler ob_gzhandler. It automatically determines what type of content encoding the browser will accept ("gzip", "deflate" or none at all) and will return its output accordingly. Just put ob_start('ob_gzhandler') at the start of your script file (before anything is put out) and it does the rest.

Or you simply use Apache’s mod_deflate that even can compress static files that are directly passed through to the client.

Answer2:

If you upload a tiny little PHP file to your server containing the following you can see all the output from phpinfo. Lots of interesting details.

<?php phpinfo(); ?>

Searching the page for "Loaded Modules" should show all the modules that are loaded. Look for mod_deflate also as that seems to be more common (comes with Apache 2.0 installs anyway). Performance? gzip might be more compress, deflate might be faster.

Answer3:

After reading the answers above I typed into command line

php -r "phpinfo();" | grep gzip

and it returned

gzip compression => enabled

sweet!

Recommend

  • PageSpeed site optimization trouble
  • Can PHP's ob_start be called more then once?
  • Can I make a template specialisation that inherits from its base?
  • Comparing 2 Points - java
  • Alpha 0 vs Visible = false
  • Unable to understand the working of Threads- Runnable Interface
  • Wamp server and php files [closed]
  • How to check if my shared hosting provider has mod_gzip installed?
  • asp.net Dropdownlist conditional postback
  • Hadoop namenode memory usage
  • Python Program on Perfect Squares [duplicate]
  • Functional Programming in Swit to distribute array elements to correct “buckets”
  • countdown bar android example
  • HttpURLConnection Closing IO Streams
  • Yii2: Finding file and getting path in a directory tree
  • How can I restyle a word when rendering a pdf with pdf.js?
  • what makes a request a new request in asp.net C#
  • Clear activity stack before launching another activity
  • Angular2 Response for preflight is invalid (redirect) from some GET requests
  • How do I configure context broker accept post requests from my remote sensor?
  • System.InvalidCastException: Specified cast is not valid
  • AJAX Html Editor Extender upload image appearing blank
  • Why Encoding.ASCII != ASCIIEncoding.Default in C#?
  • Read a local file using javascript
  • Encrypt data by using a public key in c# and decrypt data by using a private key in php
  • Align navbar back button on right side
  • DotNetZip - Calculate final zip size before calling Save(stream)
  • Apache 2.4 and php-fpm does not trigger apache http basic auth for php pages
  • SSO with signing and signature validation doesn't work
  • Deserializing XML into class C#
  • Warning: Can't call setState (or forceUpdate) on an unmounted component
  • VB.net deserialize, JSON Conversion from type 'Dictionary(Of String,Object)' to type '
  • Load html files in TinyMce
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • Free memory of cv::Mat loaded using FileStorage API
  • How do I configure my settings file to work with unit tests?
  • Exception on Android 4.0 `android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode)`
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • costura.fody for a dll that references another dll
  • Binding checkboxes to object values in AngularJs