2016-02-26 141 views
0

我的设置:的WordPress升级到4.4.2失败

OS: CentOS 7.1 
http user: apache 
http group: apache 

当我进行自动更新,我得到以下错误:

Downloading update from https://downloads.wordpress.org/release/wordpress-4.4.2-new-bundled.zip

Unpacking the update…

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

Installation Failed

我试图升级具有完全权限,但没有运气:

#find . -type f -exec chmod 666 {} \; 
#find . -type d -exec chmod 777 {} \; 

任何人有任何线索?我搜索了几个小时,但没有运气。

回答

0

我结束了手动升级,工作顺利。

0

有时一些(安全)插件似乎会干扰更新旧版本的WordPress。尝试停用插件并重试。

如果一切都失败了,只需通过FTP执行手动更新。

+0

会尝试更新回 –

+0

但有评论值得一提的是,我复制了整个网站,并安装在本地使用Win7上XAMPP。升级进展顺利。这就是为什么我从不怀疑插件。 –

+0

这没有工作.. :(任何其他线索? –

1

请勿使用777权限! Wordpress只需要755用于目录,644用于文件,666用于themesplugins目录&文件。为了安全起见,您可以给600wp-config.php。你可以看到的Wordpress文档file permission

我有这个问题,这就是我如何解决问题。

  • 确保所有的都属于Apache。
    sudo chown -R apache:apache /var/www/html/sitedir

  • 给予适当的权限
    sudo find /var/www/html/sitedir -type d -exec chmod 755 {} +
    ,将给予755权限的所有目录中sitedir
    sudo find /var/www/html/sitedir -type f -exec chmod 644 {} +
    ,将给予644以上
    sudo find /var/www/html/sitedir/wp-content/themes -type f -exec chmod 666 {} +
    sudo find /var/www/html/sitedir/wp-content/plugins -type f -exec chmod 666 {} +
    这两个命令的所有文件使666权限内的主题和插件目录

  • 所有文件如果您使用SELinux的
    sudo chcon -R system_u:object_r:httpd_sys_content_t:s0 /var/www/html/sitedir
    sudo chcon -R system_u:object_r:httpd_sys_rw_content_t:s0 /var/www/html/sitedir/wp-content
    两个以上命令会改变你的文件和目录的内容。如果你使用的话,重新启动php-fpm。

    更新:
    如果你不明白这一点。您可能还需要为selinux设置本地策略模块。 sudo grep php-fpm /var/log/audit/audit.log | audit2allow -M mypol
    sudo semodule -i mypol.pp
    然后重新启动php-fpm。

我也对我的博客:) cover this Wordpress permission issue详细