WP自动升级失败—不一致的文件权限wp-admin/includes/update-core.php

点击自动更新出现:

The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php

大意是: 自动更新失败, 因为我们不能复制某些文件. 这通常是因为不一致的文件权限导致的, 请检查wp-admin/includes/update-core.php的文件权限.

其解决办法在这里: wordpress permissions update error resolved
具体地, 先切换到wp所在目录, 例如我的是在:/var/www/blog/

  1. 更改wordpress目录下文件的权限为644: sudo find wordpress/ -type f -exec chmod 664 {} \;
  2. 更改wordpress目录下目录的权限为775: sudo find wordpress/ -type d -exec chmod 775 {} \;
  3. 更改wordpress目录下个文件以及目录的用户组: chgrp -R www-data wordpress/

此外,升级时还会碰到提示输入ftp用户名密码, 这只需在`wp-config.php`中添加
`define(‘FS_METHOD’,’direct’);`
再次更新, 应该可以成功了.

Leave a Reply

Your email address will not be published. Required fields are marked *