If you are using PHP 7.4 you need to enter the paths PHP is allowed to write to. Seems to be a new security feature:
systemctl edit php-fpm.service
Then enter something like this
[Service]
ReadWritePaths = /usr/share/webapps/nextcloud/apps
ReadWritePaths = /usr/share/webapps/nextcloud/apps2
ReadWritePaths = /etc/webapps/nextcloud/config/
And afterwards restart php.fpm: systemctl restart php-fpm.service
Source: [NC18] Problem to access data folder after upgrade to php 7.4