• Resolved dudefella

    (@dudefella)


    Hi there,

    Since version 2.8.8, the following fatal error is being thrown on sites using the W3TC_CONFIG_DATABASE constant set to “true”:

    PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 1073741832 bytes) in /var/www/pub/wp-content/plugins/w3-total-cache/ConfigDbStorage.php on line 499

    Changing memory_limit does not resolve the issue (tested increasing from 256M to 1024M), which suggests a memory leak somewhere in ConfigDbStorage.php.

    A quick glance would suggest a change to the while loop in the query function within this file results in an infinite loop:

    2.8.8:

    $row = mysqli_fetch_object( $this->result );
    while ( false !== $row ) {
    $this->last_result[ $num_rows ] = $row;
    ++$num_rows;
    $row = mysqli_fetch_object( $this->result );
    }

     2.8.6:

    while ( $row = mysqli_fetch_object( $this->result ) ) {
    $this->last_result[$num_rows] = $row;
    $num_rows++;
    }

    Downgrading back to 2.8.6 resolves this issue. I have not tested 2.8.7. Use of W3TC_CONFIG_DATABASE is required in this instance due to the production environment used.

    PHP Version: 8.1

    Thanks,

    Emmanuel

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP Fatal Error when using W3TC_CONFIG_DATABASE’ is closed to new replies.