I am having issues with my website getting errors occasionally (not consistent, every 4th page or so). When I check the error log I get the following message:
[04-Jun-2020 14:57:22 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /home/sitename/public_html/wp-includes/meta.php on line 964
99% of the time it is line 964, rarely it is line 960. I really dont think this has to do with memory size as our memory is set to 512M, I thought it might have been an issues with W3 total cache, but deactivating the plugin didn't seem to have any affect.
Here is the meta.php code from line 949-964.
if ( ! empty( $meta_list ) ) {
foreach ( $meta_list as $metarow ) {
$mpid = intval( $metarow[ $column ] );
$mkey = $metarow['meta_key'];
$mval = $metarow['meta_value'];
// Force subkeys to be array type.
if ( ! isset( $cache[ $mpid ] ) || ! is_array( $cache[ $mpid ] ) ) {
$cache[ $mpid ] = array();
}
if ( ! isset( $cache[ $mpid ][ $mkey ] ) || ! is_array( $cache[ $mpid ][ $mkey ] ) ) {
$cache[ $mpid ][ $mkey ] = array();
}
// Add a value to the current pid/key.
$cache[ $mpid ][ $mkey ][] = $mval;
I am fairly new to this so any help is really appreciated as I am just trying to help fix my family's business website
Thanks!