WP-CLI root vs non-root user
-
So I’m getting my feet wet with WP-CLI, but I’m confused about root vs non-root user.
If I’m using my non-root user, I don’t have privileges in /var/www/html/domain. If I sudo, WP-CLI throws a hissy fit about not using root.
If I go to /var/www/html and mkdir domain, then domain is owned by root. If I go to /var/www/html/domain and ‘wp core download’, I get ‘Error: ‘/var/www/html/ask/’ is not writable by current user.’ It gives further reasons why running as root is a bad idea, instructions for doing it anyway, and then “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>”.
So what user should I be using if I shouldn’t use root and I can’t use my own regular non-root user? Do I need to move my installs to my home folder? Or is there some other way to use WP-CLI in the normal /var/www/html/domain directories?
- The topic ‘WP-CLI root vs non-root user’ is closed to new replies.