How to execute OCC commands on debian

Stupid but I cannot figer out how to run ooc commands
eg. sudo -u www-data php /var/www/nextcloud/db:add-missing-indices

image

I have googled now for hours, but I cannot get How-To!
A shame!

Pls tell me how to run OCC commands.
Pls. No advice to google or "RTFM"
THX

Please check:

  1. which sudo (should point to /usr/bin/sudo)
  2. dpkg -l | grep sudo (should find sudo 1.8.27-1+deb10u3)

If you do not find sudo, then run “apt install sudo”, afterwards retry your command …

Apart from sudo obviously not being installed, the command is wrong.

So, after installing sudo like described by @abyss02, the command should be:

sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices
1 Like

Double check who your user is for the website?

Since you’re already signed in as root, does it work without sudo?