Nextcloud version (eg, 20.0.5): 28.0.2
Operating system and version (eg, Ubuntu 20.04): 22.04
PHP version (eg, 7.4): 8.1
The issue you are facing:
I tried to using a occ command in the directory of nextcloud. I got this error and now I don’t know what to do:
The output from the console nextcloud/:
PHP Warning: require_once(/root/nextcloud/nextcloud/console.php): Failed to open stream: Permission denied in /root/nextcloud/nextcloud/occ on line 11
PHP Fatal error: Uncaught Error: Failed opening required '/root/nextcloud/nextcloud/console.php' (include_path='.:/usr/share/php') in /root/nextcloud/nextcloud/occ:11
Stack trace:
#0 {main}
thrown in /root/nextcloud/nextcloud/occ on line 11
Hmmm - maybe you might run into truble, because the /root folder only has permissions to user “root”.
I am not sure, whether it is a general requirement:
Nextcloud requires permissions to user www-data, so it in normal cases will be installed f.e. in /var/www/nextcloud