Details
Nextcloud version: N/A
Operating system and version : Ubuntu 18.04
Apache or nginx version : Caddy v2.1.1
PHP version : 7.2
Reproduction
Hi folks. I am completely baffled by this permissions error.
My server is caddy, running as user ‘caddy’ and serving from /srv/nextcloud. I’m not using SELinux.
# ls -laZ /srv/nextcloud
total 172
drwxr-xr-x 2 caddy caddy ? 4096 Aug 5 13:00 .
drwxr-xr-x 5 caddy caddy ? 4096 Aug 5 12:43 ..
-rw-r--r-- 1 caddy caddy ? 158285 Feb 20 14:31 setup-nextcloud.php
-rw-r--r-- 1 caddy caddy ? 34 Aug 5 12:55 whoami.php
# cat /srv/nextcloud/whoami.php
<?php echo get_current_user(); ?>
# curl http://nextcloud.mydomain.tld/whoami.php; echo
caddy
Clearly, the webserver can read and write to /srv/nextcloud:
# sudo -u caddy touch /srv/nextcloud.test.php
# sudo -u caddy echo "I can RW!" > /srv/nextcloud/test.php
# ls -l /srv/nextcloud
total 164
-rw-r--r-- 1 caddy caddy 158285 Feb 20 14:31 setup-nextcloud.php
-rw-r--r-- 1 caddy caddy 10 Aug 5 13:01 test.php
-rw-r--r-- 1 caddy caddy 34 Aug 5 12:55 whoami.php
# curl http://nextcloud.mydomain.tld/test.php
I can RW!
But I still get this error.
Can’t write to the current directory. Please fix this by giving the webserver user write access to the directory.
# curl -s http://nextcloud.mydomain.tld/setup-nextcloud.php?step=1 | grep "Dependencies"
<p class="warning" style="text-align:center; font-size:13px;">Dependencies not found.<br />Can't write to the current directory. Please fix this by giving the webserver user write access to the directory.<br/></p>
I’ve also tried manual installs , but they’ve all ended in some kind of “Operation not permitted” error.
Not sure if this is a NextCloud issue, a caddy issue, or an ubuntu issue. Hopefully someone can point me in the right direction.