Do CLI commands only run for root user

I want to clear the fast-cgi cache from the ssh command line. I can do this without difficulty if I log in as root and issue the command

v-delete-fastcgi-cache user example.com

However, if I log in as another ssh user (with sudo privileges) and type

v-delete-fastcgi-cache user example.com

I get the error “user user doesn’t exist”. If I type

sudo v-delete-fastcgi-cache user example.com

I get the error “sudo: v-delete-fastcgi-cache: command not found”.

Does this mean that I can only run this (and other CLI commands?) as root user? I have checked the file permissions, and although the file /usr/local/hestia/bin/v-delete-fastcgi-cache belongs to the root user, its permissions allow any user to execute it (755).

I would actually like to execute this command from a php script, so I should imagine that doing that would require being able to execute it as another user other than root.

Any guidance would be appreciated!

Yes

Root is required

Thank you, @eris, that is helpful.

Following on from that, I would like to ask which user the nginx server runs under. What I am thinking of, is if I run a php script under some domain, will it be able to access these cli commands via the api?

You can all it via the the API it should work fne

Thank you, @eris.