WordPress Upgrade Failed: Could not copy file

Last updated on November 26th, 2023

Obviously I like to keep WordPress up-to-date to ensure it has the latest security patches, and that any new features, or improvements are available to myself, and you lovely readers!

Well of late I’ve had issues upgrading WordPress. I’ve tried the automatic upgrade on several occasions, but it continues to give me an “Installation Failed” error message.

It’s clear that this is permission based, as WordPress kindly points to the file its just taken ages downloading (the updated version of WordPress) and says it can’t copy the file (locally, as it’s already successfully downloaded it to our server). So what’s the issue?

Well I’ve tried a lot of the tricks suggested on the Internet, and I’ve also tried getting very cross with it… it turns out the below fixed it for me, so hopefully it might work for others:

– Simply goto the root directory of your blog by FTP or SSH, and make sure the permissions on your wp-config.php file are set to 0644. Switch the permissions back as soon as you’ve done the upgrade (you must change the permissions back to their original setting as 0644 gives the public access to your config file, which contains your databbase username and password for WordPress).

To minimise any security risk while doing the above, it is worth adding the below to your .htaccess file in the blog root directory. This will prevent people accessing your wp-config.php file while you are doing the upgrade.

<Files wp-config.php>
order allow,deny
deny from all
</Files>

One response to “WordPress Upgrade Failed: Could not copy file”

Adblocker detected

Please bear in mind that ad blockers prevent this website covering its costs.

If you find this site useful, please consider supporting me by whitelisting this site, or making a £1 / $1 donation.