Wordpress upgrade to 4.4.2 failed -


my setup:

os: centos 7.1 http user: apache http group: apache 

when perform automatic update, below error:

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

unpacking update…

the update cannot installed because unable copy files. due inconsistent file permissions.: wp-admin/includes/update-core.php

installation failed

i have tried upgrade full permission no luck:

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

anyone has clues? searched hours no luck.

do not use 777 permission! wordpress need 755 directories, 644 files, , 666 themes , plugins directories & files. , give 600 wp-config.php security. can see wordpress documentation file permission

i had problem, , how solved issues.

  • make sure owned apache.
    sudo chown -r apache:apache /var/www/html/sitedir

  • give proper permissions
    sudo find /var/www/html/sitedir -type d -exec chmod 755 {} +
    give 755 permission directory inside sitedir
    sudo find /var/www/html/sitedir -type f -exec chmod 644 {} +
    give 644 files
    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 {} +
    2 commands above make 666 permission files inside themes , plugins directory

  • if use 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
    2 commands above change context of files , directories. , restart php-fpm if use one.

    update:
    if don't through until point. might need set local policy module selinux. sudo grep php-fpm /var/log/audit/audit.log | audit2allow -m mypol
    sudo semodule -i mypol.pp
    restart php-fpm.

i cover wordpress permission issue more detail on blog :)


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -