%
image/svg+xml

(tip) Nextcloud Php Chroot OpenBSD

Article published the ; modified the
One minute to read

This article has 130 words.
RAW source of the article:
Commit version: e21600e

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…