Hi,
I’ve been debugging this problem a bit and found a solution. However I have other wordpress in the same hosting that updates without errors…
First step is get more information about the problem, so I modified line 1376 of file wp-admin/includes/class-wp-upgrader.php
from:
return new WP_Error( 'copy_failed_for_update_core_file', __( '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' );
to
return new WP_Error( 'copy_failed_for_update_core_file', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), $working_dir . '/wordpress/wp-admin/includes/update-core.php --' . $wp_dir . 'wp-admin/includes/update-core.php' );
And run the upgrade core again to see what is trying to copy. In my case it outputs:
/www/wp-content/upgrade/wordpress-3.tmp/wordpress/wp-admin/includes/update-core.php –/home/myuser/www/wp-admin/includes/update-core.php
As you can see one path starts with /home/myuser/www and other starts with /www
I don’t know why or where wordpress obtains different paths here…
Next step is remove /home/myuser from the source path, so I added this code after line 1341:
$wp_dir = trailingslashit($wp_filesystem->abspath());
$wp_dir = str_replace('/home/myuser', '', $wp_dir); //new code
After this change I could upgrade to 3.8.1 without any problems 😉
Sorry, I meant to remove the /home/myuser from the destination path (not the source)
And also apology for my english.
I am having the exact same issue.
I followed the instructions below and the error changed to be a different file later in the install process. The edits that I had made to class-wp-upgrader.php had been blown away already by the installation process.
Is this really an issue with the WP Better Security plugin or is there a problem generally with the update process for 3.8.1?
@jdminv: If you require assistance then, as per the Forum Welcome, please post your own topic.
This topic references an old version of WordPress.
Hi @jdminv, I don’t have WP Better Security plugin installed, so it should be from the WordPress itself.
@aposai: so why are you posting in this topic
Ups, sorry @esmi, my mistake. I didn’t realize it was the plugin forum, just googling for the same error and found this thread, so after found a solution by myself I posted here to help other users.