Wp-cli: Permission denied error when CLI update

Created on 8 Jul 2016  路  3Comments  路  Source: wp-cli/wp-cli

I installed following steps given in the Installing section. When there is update available for CLI and I run wp cli update, I get Permisson denied error in /usr/local/bin/wp. Unfortunately, I am still not able to fix that, and I update CLI following steps for Installing. Anybody facing issue similar to this? May be this could be one configuration problem.

unconfirmed

Most helpful comment

Is anyone else also facing this issue?

It's a permissions issue, specific to your server. However, anyone can experience file permissions issues. This isn't unique to WP-CLI.

Your current system user doesn't have permission to modify the file, because you used sudo to move it in place. You'll need to fix the permissions on the file such that your current system user can modify the file, or run sudo wp cli update --allow-root to perform the update operation as sudo.

All 3 comments

Check the write permissions of /usr/local/bin/wp. If you've moved the file there with sudo mv wp-cli.phar /usr/local/bin/wp you may need to update it with sudo as well:

sudo wp cli update --allow-root

Personally, I keep the wp Phar in ~/bin/wp, which I've previously added to my PATH.

I guess it is not good practice to use sudo with wp command. That is explained in the command output also.
Is anyone else also facing this issue? If not may be there is something wrong in my Ubuntu setup. I am not sure.

Is anyone else also facing this issue?

It's a permissions issue, specific to your server. However, anyone can experience file permissions issues. This isn't unique to WP-CLI.

Your current system user doesn't have permission to modify the file, because you used sudo to move it in place. You'll need to fix the permissions on the file such that your current system user can modify the file, or run sudo wp cli update --allow-root to perform the update operation as sudo.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jacklenox picture jacklenox  路  3Comments

schlessera picture schlessera  路  4Comments

dsgnr picture dsgnr  路  4Comments

mirzazeyrek picture mirzazeyrek  路  3Comments

blindpet picture blindpet  路  3Comments