PHP Fatal Error when using W3TC_CONFIG_DATABASE
-
Hi there,
Since version 2.8.8, the following fatal error is being thrown on sites using the
W3TC_CONFIG_DATABASEconstant 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 499Changing
memory_limitdoes not resolve the issue (tested increasing from 256M to 1024M), which suggests a memory leak somewhere inConfigDbStorage.php.A quick glance would suggest a change to the while loop in the
queryfunction 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_DATABASEis required in this instance due to the production environment used.PHP Version: 8.1
Thanks,
Emmanuel
The topic ‘PHP Fatal Error when using W3TC_CONFIG_DATABASE’ is closed to new replies.