wp-cli / extension-command

Manages plugins and themes, including installs, activations, and updates.
MIT License
90 stars 79 forks source link

PHP error on rename after wp plugin update #313

Closed flaggz closed 2 years ago

flaggz commented 2 years ago

Bug Report

Describe the current, buggy behavior

PHP rename error after wp plugin update command

$ sudo -u myredacteddomain.com wp plugin update --all --skip-plugins --skip-themes --path="/home/myredacteddomain.com/public_html/"

LOG

Attivazione modalità di manutenzione in corso...
Download dell'aggiornamento da https://downloads.wordpress.org/plugin/wordfence.7.5.8.zip...
PHP Warning:  rename(/tmp/wordfence.7.5.8-KiLAcA.tmp,wordfence.7.5.8.zip): Permission denied in /home/myredacteddomain.com/public_html/wp-admin/includes/file.php on line 1201
Warning: rename(/tmp/wordfence.7.5.8-KiLAcA.tmp,wordfence.7.5.8.zip): Permission denied in /home/myredacteddomain.com/public_html/wp-admin/includes/file.php on line 1201
Estrazione dell’aggiornamento in corso...
Installazione dell’ultima versione in corso...
Rimozione della vecchia versione del plugin...
Il plugin è stato aggiornato con successo.
Disattivazione modalità di manutenzione in corso...
name    old_version new_version status
wordfence   7.5.7   7.5.8   Updated 
$ ls -la /
...
drwxrwxrwt  14 root root 20480 Feb  2 14:24 tmp
...

Describe how other contributors can replicate this bug

Describe what you would expect as the correct outcome

Update plugin without warning

Let us know what environment you are running this on

OS: Linux 5.10.0-11-amd64 #1 SMP Debian 5.10.92-1 (2022-01-18) x86_64
Shell:  
PHP binary: /usr/bin/php8.1
PHP version:    8.1.2
php.ini used:   /etc/php/8.1/cli/php.ini
MySQL binary:   /bin/mysql
MySQL version:  mysql  Ver 15.1 Distrib 10.5.12-MariaDB, for debian-linux-gnu (x86_64) using  EditLine wrapper
SQL modes:  
WP-CLI root dir:    phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:  phar://wp-cli.phar/vendor
WP_CLI phar path:   /home/redacted
WP-CLI packages dir:    
WP-CLI global config:   
WP-CLI project config:  
WP-CLI version: 2.6.0

Provide a possible solution

Provide additional context/Screenshots

danielbachhuber commented 2 years ago

Thanks for the report, @flaggz !

It seems like the error is caused by some file permission issues on your system. You'll need to resolve those in order for WP-CLI to operate properly.

Feel free to stop by the #cli channel on WordPress.org Slack if you'd like help debugging further.