Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wp core update "Warning: Failed to create directory '/var/www/.wp-cli/cache/': mkdir(): Permission denied." #265

Open
1 task done
Danrancan opened this issue Jul 29, 2024 · 0 comments

Comments

@Danrancan
Copy link

Bug Report

Describe the current, buggy behavior

I am trying to upgrade my wordpress installation from the wp cli. From the ssh terminal I move into the wordpress directory in /var/www/example.com. Then I execute the following command:

wp plugin deactivate --all
Plugin 'tinymce-advanced' deactivated.
Plugin 'akismet' deactivated.
Plugin 'autoptimize' deactivated.
Plugin 'classic-widgets' deactivated.
Plugin 'contact-form-manager' deactivated.
Plugin 'webp-converter-for-media' deactivated.
Plugin 'duplicate-page' deactivated.
Plugin 'emails-verification-for-woocommerce' deactivated.
Plugin 'envato-market' deactivated.
Plugin 'hcode-addons' deactivated.
Plugin 'mime-types-plus' deactivated.
Plugin 'newsletter-manager' deactivated.
Plugin 'nginx-helper' deactivated.
Plugin 'one-user-avatar' deactivated.
Plugin 'woo-stripe-payment' deactivated.
Plugin 'seo-by-rank-math' deactivated.
Plugin 'seo-by-rank-math-pro' deactivated.
Plugin 'real-media-library-lite' deactivated.
Plugin 'redis-cache' deactivated.
Plugin 'simple-cloudflare-turnstile' deactivated.
Plugin 'revslider' deactivated.
Plugin 'social-media-auto-publish' deactivated.
Plugin 'woocommerce' deactivated.
Plugin 'woocommerce-paypal-payments' deactivated.
Plugin 'woocommerce-services' deactivated.
Plugin 'js_composer' deactivated.
Plugin 'wp-mail-smtp' deactivated.
Plugin 'amazon-s3-and-cloudfront' deactivated.
Success: Deactivated 28 of 28 plugins.

Then I attempt to update wordpress from the wp cli:

Danran@mail:/var/www/example.com$ wp core update
Updating to version 6.6.1 (en_US)...
Warning: Failed to create directory '/var/www/.wp-cli/cache/': mkdir(): Permission denied.
Downloading update from https://downloads.wordpress.org/release/wordpress-6.6.1-no-content.zip...
Unpacking the update...
PHP Warning:  copy(/var/www/example.com/wp-config-sample.php): Failed to open stream: Permission denied in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 309
Warning: copy(/var/www/example.com/wp-config-sample.php): Failed to open stream: Permission denied in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 309
PHP Warning:  chmod(): No such file or directory in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 173
Warning: chmod(): No such file or directory in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 173
PHP Warning:  chmod(): No such file or directory in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 173
Warning: chmod(): No such file or directory in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 173
PHP Warning:  copy(/var/www/example.com/wp-config-sample.php): Failed to open stream: Permission denied in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 309
Warning: copy(/var/www/example.com/wp-config-sample.php): Failed to open stream: Permission denied in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 309
PHP Warning:  chmod(): No such file or directory in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 173
Warning: chmod(): No such file or directory in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 173
PHP Warning:  copy(/var/www/example.com/wp-config-sample.php): Failed to open stream: Permission denied in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 309
Warning: copy(/var/www/example.com/wp-config-sample.php): Failed to open stream: Permission denied in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 309
PHP Warning:  chmod(): No such file or directory in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 173
Warning: chmod(): No such file or directory in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 173
PHP Warning:  chmod(): No such file or directory in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 173
Warning: chmod(): No such file or directory in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 173
PHP Warning:  copy(/var/www/example.com/wp-config-sample.php): Failed to open stream: Permission denied in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 309
Warning: copy(/var/www/example.com/wp-config-sample.php): Failed to open stream: Permission denied in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 309
PHP Warning:  chmod(): No such file or directory in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 173
Warning: chmod(): No such file or directory in /var/www/example.com/wp-admin/includes/class-wp-filesystem-direct.php on line 173
Error: Could not copy file. "wp-config-sample.php"

NOW, I am stuck with a broken/botched Wordpress installation. When I go to www.example.com, it says "Critical Error", on a blank white page.

Describe how other contributors can replicate this bug

  • Just go to your wordpress directory and execute wp core update
  • the error condition: I don't know what this means.
// You can also use code snippets if needed.

Describe what you would expect as the correct outcome

I expect wordpress to be updated correctly without problems.

Let us know what environment you are running this on
Ubuntu 22.04 Server for Raspberry Pi 4 (aarch64)
Nginx v1.27.0 Mainline
MariaDB 10.11.8
PHP v8.1.2

Danran@mail:/var/www/example.com$ wp cli info
OS:	Linux 5.15.0-1055-raspi #58-Ubuntu SMP PREEMPT Sat May 4 03:52:40 UTC 2024 aarch64
Shell:	/usr/sbin/nologin
PHP binary:	/usr/bin/php8.1
PHP version:	8.1.2-1ubuntu2.18
php.ini used:	/etc/php/8.1/cli/php.ini
MySQL binary:	/usr/bin/mysql
MySQL version:	mysql  Ver 15.1 Distrib 10.11.8-MariaDB, for debian-linux-gnu (aarch64) 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:	/var/www/example.com
WP-CLI packages dir:
WP-CLI cache dir:	/var/www/.wp-cli/cache
WP-CLI global config:
WP-CLI project config:
WP-CLI version:	2.10.0

How can I fix this so I no longer have a botched update installation? I have backups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant