wp-cli : Permissions issue (on Linux/Ubuntu)
-
When using wp-cli it seems that there are permission problems when (eg) installing plugins. The Linux system needs permission to create the new plugin directory and (I think) the WordPress system needs permission to install the plugin. The error/warning that comes back is: “Warning: Could not create directory.”
What is the proper way to invoke this tool in such a way as to avoid this error?
Here’s what I had to do to get wp-cli to work for me :
1. Make sure the directories are all owned by www-data
2. Make sure www-data is in /etc/sudoers (not sure if this is a security problem)
3. Create a password for www-data group with “sudo passwd www-data”
4. Invoke “wp” (or the script containing it) with: “sudo -u www-data …”
5. Add this option to the “wp” command: –user=<username>…but I assume there is a more straightforward way.
Please advise. Thanks in advance for the help
- The topic ‘wp-cli : Permissions issue (on Linux/Ubuntu)’ is closed to new replies.