GZIP Compression not working

Hi,

I have an issue with Hummingbird.
I can't get Hummingbird to perform a GZIP Compression. I keep getting the same error message:
gzip is not working properly:
- Your server may not have the "deflate" module enabled (mod_deflate for Apache, ngx_http_gzip_module for NGINX)
- Another plugin may be interfering with the configuration

I have turned off all plugins except Hummingbird and Woocommerce. I have changed theme to Storefront. I have made sure that my hosting supplier uses mod_deflate for Apache for the server my domain is on.
Still, I get the same error message.

Any ideas?

Regards,
Filip

  • filip
    • WPMU DEV Initiate

    Hey Kasia,

    Thanks for your time.

    I'm honestly not sure where to find the php.ini file mentioned in the link you provided.
    I tried creating a file using notepad where I pasted: zlib.output_compression = On
    I named the file php.ini BTW.
    I placed the file in the wp-admin folder of my FTP but that didn't change anything, sadly.

    Perhaps I did something wrong or perhaps the solution provided isn't the solution for me.

    Any other suggestions or thoughts?

    BR,
    Filip

  • Ash
    • WordPress Hacker

    Hello Filip

    If you are in a shared hosting, you won't have access to php.ini file. You can create a php.ini file in your webroot (public_html) folder, but still it might not be workable, depends on the settings in your server.

    Could you please create a file in your webroot called - info.php and put the following in there?

    <?php
    phpinfo();

    Then give us the file url (it might be http://domain.com/info.php).

    Have a good day!

    Cheers
    Ash

  • Nithin
    • Support Wizard

    Hi filip,

    Hope you are doing good today. :slight_smile:

    Thank you for sharing the info.php file, it seems like your server runs on Apache v2.2. You'll have to add the following code in order to get this working:

    <?php
    add_filter( 'wphb_code_snippet', function( $code, $server, $module ) {
        if ( 'gzip' === $module->get_slug() && 'apache' === $server ) {
            return 'SetOutputFilter DEFLATE';
        }
    
        return $code;
    }, 10, 3 );

    You'll have to create a folder named mu-plugins, inside your /wp-content folder using a FTP client, and add a php file, and the paste the above code to it.

    Once done, enable Compression under, Hummingbird > GZip Compression, to get GZip compression working.

    I have already attached a file below with the following code, all you have to do is create a mu-plugins folder, and copy this file into your mu-plugins folder to get this working.

    Please let us know if you still need any further assistance. Have a nice day. :slight_smile:

    Kind Regards,
    Nithin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.