Server not reachable (Internal server error) after restoring whole RPi backup

Hello,
this morning i upgraded my nextcloud server from version 24.0.3 to 24.0.4. As soon as the installation was completed I noticed a slowdown and a blockage of the whole system, so I tried to restart the RPi and I noticed that shortly after starting I had dozens of active apache2 processes that, in a few seconds, would have occupied me all ram (4GB) and 1GB Swap.
At this point, having backups of the entire system available, I thought about restoring the most recent one (from 5 days ago), but when I turned on I noticed that when I opened the url of my nextcloud, the browser gave me the error of the screenshoot attached.


I tried rebooting and also restoring the other 2 older backups, but I always found the same error.
I then tried to open the log (located on /var/www/nextcloud/data/nextcloud.log) that I report below, but without any clear problems reported.

{"reqId":"3VljEJWSxZ9WKQ0wjByW","level":2,"time":"2022-02-18T19:48:48+00:00","remoteAddr":"192.168.178.23","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/","message":"Could not detect any host in http:///nextcloud/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.55","version":""}
{"reqId":"3VljEJWSxZ9WKQ0wjByW","level":2,"time":"2022-02-18T19:48:48+00:00","remoteAddr":"192.168.178.23","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/","message":"Could not detect any host in https:///nextcloud/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.55","version":""}
{"reqId":"boGxuMhDRCoQ8RSHkQ3m","level":2,"time":"2022-02-18T19:49:58+00:00","remoteAddr":"192.168.178.23","user":"--","app":"no app in context","method":"POST","url":"/nextcloud/index.php","message":"Could not detect any host in http:///nextcloud/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.55","version":""}
{"reqId":"boGxuMhDRCoQ8RSHkQ3m","level":2,"time":"2022-02-18T19:49:58+00:00","remoteAddr":"192.168.178.23","user":"--","app":"no app in context","method":"POST","url":"/nextcloud/index.php","message":"Could not detect any host in https:///nextcloud/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.55","version":""}

Since the “htaccess” file is reported, I report what is present in the .htaccess file in the data folder:

# Generated by Nextcloud on 2022-02-18 19:49:58
# Section for Apache 2.4 to 2.6
<IfModule mod_authz_core.c>
  Require all denied
</IfModule>
<IfModule mod_access_compat.c>
  Order Allow,Deny
  Deny from all
  Satisfy All
</IfModule>

# Section for Apache 2.2
<IfModule !mod_authz_core.c>
  <IfModule !mod_access_compat.c>
    <IfModule mod_authz_host.c>
      Order Allow,Deny
      Deny from all
    </IfModule>
    Satisfy All
  </IfModule>
</IfModule>

# Section for Apache 2.2 to 2.6
<IfModule mod_autoindex.c>
  IndexIgnore *
</IfModule>

I do not understand what could be wrong, as it is the same hardware as before and with the same configurations.
Apache2 works correctly.
For your information, I report some references of my configuration:
Apache2
php 8.0
RaspberryPi OS Bullseye 64bit

Thank you

Marco

Problem solved by removing and then reinstalling all the various php modules and then reconfiguring the necessary (as during the first installation and configuration).