Support » Plugin: WooCommerce » PHP Fatal woocommerce/includes/class-wc-download-handler.php on line 559 + info

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Rafy a11n

    (@nawaz0705)

    Hi @axaak

    Thank you for reaching out!

    Can you please check if GZIP is enabled or disabled on your web server, as the line 533 actually checks if that is disabled or not?

    You can check this documentation to disable GZIP and see if this solves the fatal error issue: https://fedingo.com/how-to-disable-gzip-compression-in-apache/

    Thread Starter axaak

    (@axaak)

    Hi @nawaz0705,
    thanks for responding. The Apache deflate module is enabled. I have disabled gzip just for this vhost and the error no longer appears.
    I don’t think disabling gzip is a long term solution though?

    • This reply was modified 4 months, 2 weeks ago by axaak.
    Thread Starter axaak

    (@axaak)

    It seems php 8.0 does not allow dereferencing of numbers. The manual seems quite clear on this:
    https://www.php.net/manual/en/language.references.pass.php

    This change to the woo code works here:

    From

                    if ( function_exists( 'apache_setenv' ) ) {
                            @apache_setenv( 'no-gzip', 1 ); // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged, WordPress.PHP.DiscouragedPHPFunctions.runtime_configuration_apache_setenv
                    }
    

    To:

                    if ( function_exists( 'apache_setenv' ) ) {
                            $one    = 1;
                            @apache_setenv( 'no-gzip', $one ); // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged, WordPress.PHP.DiscouragedPHPFunctions.runtime_configuration_apache_setenv
                    }
    

    Obviously this won’t survive an upgrade so it would be good if somebody from Woo could take a look please.
    I think the line
    if ( function_exists( 'apache_setenv' ) ) {
    returns false under php-fpm which is why we only get the problem when using the module.

    • This reply was modified 4 months, 2 weeks ago by axaak.
    • This reply was modified 4 months, 2 weeks ago by axaak.
    Plugin Support Mirko P.

    (@rainfallnixfig)

    Hello @axaak,

    This change to the woo code works

    Would you mind sharing your findings with Woo developers in Github?

    That’s the place where they can take a look at issues like the one you reported here and let you know if changes will be needed to the core plugin.

    https://github.com/woocommerce/woocommerce/issues/new/choose

    Cheers.

    Thread Starter axaak

    (@axaak)

    @rainfallnixfig thanks for responding. I’ve raised issue #34710.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.