A couple of days ago I configured my server to use PHP-FPM to use different versions of PHP for different sites. After that they worked fine. Two Drupal 9 sites are using PHP 8.1, other Drupal 7 sites are using PHP 7.4.
Without any changes I am aware of, the sites stopped working. The server log file contains a warning regarding memory usage:
PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted
(tried to allocate 7002662505284858752 bytes) in Unknown on line 0
I had already raised the memory_limit from 512mb to 1gb. Before, the error message reflected the other setting:
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted
(tried to allocate 7002662505284858752 bytes) in Unknown on line 0
I even tried to set it to -1:
PHP Fatal error: Out of memory (allocated 2097152) (tried to allocate
7002662505284858752 bytes) in Unknown on line 0
How on earth could Drupal suddenly use 7.002.662.505.284.858.752 bytes of memory? That's 7.002.662.505 gb or 7.002.662 tb.
At the same time I got errors regarding SSL certificates. All sites use certificates from Let's Encrypt and worked without a problem. Running checks on https://www.ssllabs.com, no problem appears. I configured the sites to run without https, but the memory error remains.
I can't even log into my sites, but using Drush, the watchdog log doesn't show anything important.
On some pages or sites, using Chrome, I get the error ERR_EMPTY_RESPONSE.
I am kind of lost after some hours of searching. Does anybody have an idea what could be causing this?
Update:
I created an issue on drupal.org: Auto-generated .htaccess in files directory breaks sites