After PHP8.1 Update: AH01071: Got error 'Unable to open primary script: redirect:/index.php

Nextcloud version (eg, 20.0.5): 25.0.1
Operating system and version (eg, Ubuntu 20.04): 20.0.4
Apache or nginx version (eg, Apache 2.4.25): 2.4
PHP version (eg, 7.4): 8.1-fpm

The issue you are facing:
I have the problem that as soon as I upgrade PHP from 8.0 to 8.1, the Nextcloud instance does not work properly.

The problem manifests itself in the Apache2 logs as follows:

[Tue Dec 13 16:10:02.063386 2022] [proxy_fcgi:error] [pid 3355489:tid 139985303860992] [client 37.24.93.105:52637] AH01071: Got error ‘Unable to open primary script: redirect:/index.php (No such file or directory)’

This error appears every second, with every interaction with Nextcloud. It leads to the fact that e.g. the main files folder can no longer be opened.

Does anyone here have an idea?

Is this the first time you’ve seen this error? (Y/N):

Steps to replicate it:

  1. Update PHP from 8.0 to 8.1
  2. Visit Backend of Nextcloud
  3. Click on any Icon (prefered files)