Error: Invalid data directory
Under OpenBSD, Web service and PHP are under chroot. In fact, the command occ
can not run!
When you try, we get this message:
Code: sh
To resolve this problem is very easy!
Edit the file config nextcloud/config/config.php
, to modify the value of datadirectory
, as:
'datadirectory' => ((php_sapi_name() == 'cli') ? '/var/www' : '') . '/htdocs/data',
Of course, the /htdocs/data
directory must correspond to your real case.
Now, you can use without problem the occ
command.
After, dont forget to delete yours modifications before going to the web interface, otherwise you will not to be able to connect!
TL;DR
KiSS:
- To “enable” occ:
sed -i -e 's#/htdocs#/var/www/htdocs#' nextcloud/config/config.php
- To “disable” occ:
sed -i -e 's#/var/www/htdocs#/htdocs#' nextcloud/config/config.php
Acknowledgement
I would liket to thank @h3artbl33d who found this tips…