WP-CLI issue

Discussion in 'General' started by fatmike, Aug 28, 2018.

  1. fatmike

    fatmike Member


    I've installed wp-cli using the phar file as recommended here:

    It seems that even the simplest command returns:
    [email protected] /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:
    [email protected] /var/www/clients/client1/web2/web # sudo -u web2 -i -- wp site list
    returns nothing at all.

    Any help would be appreciated.

    Kind regards
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    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

Share This Page