@ernolf, thanks for the response.
It seems that it was the same issue as described by @FadeFx a different version of PHP ran the corn. It is working now after I ensured that it uses the same path as the PHP that is assigned to this domain.
Just for your info, it is not compiled manually. All is done by APT but not in the terminal but by WEBUZO, which is the server admin software I use on this system. Anyway, the corn is running g now, but I have a huge other problem for wish I will create a new post.
Files do not display in web after DB restore - Support - Nextcloud community
php8.1 -i | grep my
Additional .ini files parsed => /etc/php/8.1/cli/conf.d/10-mysqlnd.ini,
/etc/php/8.1/cli/conf.d/20-mysqli.ini,
/etc/php/8.1/cli/conf.d/20-pdo_mysql.ini,
mysqli
Client API library version => mysqlnd 8.1.21
mysqli.allow_local_infile => Off => Off
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock
mysqli.default_user => no value => no value
mysqli.local_infile_directory => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
mysqli.rollback_on_cached_plink => Off => Off
mysqlnd
mysqlnd => enabled
Version => mysqlnd 8.1.21
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_caching_sha2_password,auth_plugin_sha256_password
API Extensions => mysqli,pdo_mysql
PDO drivers => mysql
pdo_mysql
Client API version => mysqlnd 8.1.21
pdo_mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock
root