• Hello, I am currently using version 4.7.4, and I am trying to update my test blog to the newest version of wordpress but i keep getting this error message:

    [quote]
    Unpacking the update…

    Warning: copy(/var/www/html/wp-admin/includes/update-core.php): failed to open stream: Permission denied in /var/www/html/wp-admin/includes/class-wp-filesystem-direct.php on line 257

    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
    [/quote]

    i know 777 is bad, but i thought i would try it to see if that was the problem
    i chmod all my folders and files to 777, and it still doesn’t work

    also, here is the permissions on the filesystem-direct.php

    -rwxrwxrwx. 1 apache root 11795 May 13 19:09 wp-admin/includes/class-wp-filesystem-direct.php

    what could possibily be the problem?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello @wordguy22

    Try MANUALLY updating. Download a fresh copy of the WordPress .zip file to your computer, unzip it, and use that to copy up all files and folders EXCEPT the wp-config.php file and the /wp-content/ directory. You may need to delete the old wp-admin and wp-includes folders and files on your server before uploading the new ones. Please read the Manual Update directions first.

    Hope this will help.

    Thanks.

    Thread Starter wordguy22

    (@wordguy22)

    I have manually updated before and it works fine,

    but i want to know the reason why automatic updating is not working, and fix the problem

    Hello @wordguy22

    Have you made sure that there is nothing in your wp-config.php interfering with updates? Look for something like

    define( 'WP_AUTO_UPDATE_CORE', false );

    Try using Advanced Automatic Updatesand see if it works.

    Thanks.

    Thread Starter wordguy22

    (@wordguy22)

    i left that file as default, the only thing i added was:

    define(‘FS_METHOD’, ‘direct’);

    i don’t even see that anywhere:
    define( ‘WP_AUTO_UPDATE_CORE’, false );

    should i add it in, and change it to true

    hi,

    any solutions to this? I’m facing the same issue. hope someone can advise on this.

    Hi,

    I had the same issues and finally found something else that got it fixed, so I figured I’d share…

    I found the define(‘FS_METHOD’, ‘direct’); trick, but still had the “Warning: copy(/var/www/html/wp-admin/includes/update-core.php): failed to open stream: Permission denied in /var/www/html/wp-admin/includes/class-wp-filesystem-direct.php…” issue.

    I made sure my web service had access (I’m running CentOS 7 in a Virtualbox):
    chown -R apache:apache /var/www

    Again, on the last line of /var/www/html/wp-config.php, I added:
    define(‘FS_METHOD’, ‘direct’);

    I then temporarily updated all permissions on files and directories to 777:
    find /path/to/site/ -type f -exec chmod 777 {} \;
    find /path/to/site/ -type d -exec chmod 777 {} \;

    HERE’S THE TRICK: I found somewhere that SELinux was causing problems and the solution was to run:
    chcon -R –type httpd_sys_rw_content_t /var/www/html/

    I restarted my web service (systemctl restart httpd).

    Then logged into WordPress and ran the system update and it worked!

    Once the update finished, I went back and “fixed” the permissions to recommended settings:
    find /path/to/site/ -type f -exec chmod 0664 {} \;
    find /path/to/site/ -type d -exec chmod 0775 {} \;

    I pulled my hair out for hours on this, so hope it helps someone else too. Thanks to the community for sharing their knowledge and constantly helping me out when I’m in a jam!

    Cheers

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Update WordPress Permission Denied /class-wp-filesystem-direct.php’ is closed to new replies.