• Resolved fritouz12

    (@fritouz12)


    Hello,

    I don’t understood my file permission issue with my WordPress 5.7. I’m using Centos 8.

    WP Health check say that : [Screenshot of Site Health][1]

    I try to do an upadate and it doesn’t work, I got : The update cannot be installed because we will not be able to copy some files. This problem is usually due to inconsistencies in file permissions : wp-admin/includes/update-core.php

    I’m not a beginner but despite my investigation I don’t find my issue. Here is all information that I checked :

    – In the WP folder, I run :
    chown apache:apache -R *
    find . -type d -exec chmod 755 {} \;
    find . -type f -exec chmod 644 {} \;

    – My WP folder have a 775 permission

    – I run chown apache:apache -R * in all my /var/www folder

    – When I open with my web browser a test.php file which contains <?php echo(exec(‘whoami’)); ?> , I get apache

    – When I exec with my centos user php test.php , I got centos

    – When I exec ps aux | egrep ‘(apache|httpd)’ with my centos user, I got this : [Result of ps aux | egrep ‘(apache|httpd)’ ][2]

    – When I exec with my Centos user sudo chmod 777 -R wordpress/ , the problem persist.

    – I checked /var/log/php-fpm/www-error.log and there is : [16-Apr-2021 14:27:32 UTC] PHP Warning: copy(/var/www/wordpress/wp-admin/includes/update-core.php): failed to open stream: Permission denied in /var/www/wordpress/wp-admin/includes/class-wp-filesystem-direct.php on line 309

    – Else, everything is working on my wordpress (I can upload media for example)

    Thank you a lot in advance.

    [1]: https://i.stack.imgur.com/B1Ulr.png
    [2]: https://i.stack.imgur.com/p7L9U.png

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter fritouz12

    (@fritouz12)

    + When I put all files in 777, same issue

    Thread Starter fritouz12

    (@fritouz12)

    SOLVED : it was due to SE Linux on Centos.
    Run this command : chcon -Rv –type=httpd_sys_rw_content_t /www

    Thanks.

    • This reply was modified 5 years, 1 month ago by fritouz12.

    I have some problem. When I try to update a profile (non admin but subscriber) nothing change. Profile cannot be changed.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘WP Update failed – File permission’ is closed to new replies.