I'm setting up a staging site on the same server as a live site. Wordpress 7.1, PHP 7.2. Site is a multisite install I've been working with for years.
Everything is identical apart from domain names.
php.ini memory limit is deliberately very high 500MB
php_value memory_limit 256M php_value register_globals off php_value max_execution_time 600 php_value upload_max_filesize 64M php_value post_max_size 64M
wp-config.php contains these lines:
define('WP_MEMORY_LIMIT', '256M'); define( 'WP_MAX_MEMORY_LIMIT', '256M' );
.htaccess file does not include any lines dealing with memory limits.
Everything is identical to the live site, or has a higher memory limit.
Live site works fine.
Staging site, when visiting /wp-login.php throws an out of memory error:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 19628820 bytes) in /path/to/wordpress/wp-includes/wp-db.php on line 2888
268435456 bytes is obviously equal to a very low memory limit of 32MB.
Given that the staging and live site are almost identical, any idea what's going on?
As you can imagine, this is a pretty frustrating error!