Hello. I've installed wp-cli using the phar file as recommended here: https://wp-cli.org/#installing It seems that even the simplest command returns: Code: root@server /var/www/clients/client1/web2/web # wp site list Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under. If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS. If you'd like to continue as root, please run this again, adding this flag: --allow-root If you'd like to run it as the user that this site is under, you can run the following to become the respective user: sudo -u USER -i -- wp <command> After running the command with su or sudo like that: Code: root@server /var/www/clients/client1/web2/web # sudo -u web2 -i -- wp site list returns nothing at all. Any help would be appreciated. Kind regards
Interesting application. I'll have to see if I could use it, too. Meawhile, if I were you I would install it as the website user, and run it when logged in as that website user. Create SSH user for that website if not already created. Does the cli work at all? What happens with
The correct command if logged in as root is: Code: sudo -u web2 wp site list Where web2 is the user with permissions of current website.