WordPress Upgrade Failed: Could not copy file

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, and in an attempt to keep my cool, I’ve simply walked away from it when it continues to give me a “Installation Failed” message.

It’s clear that this is permission based, as WordPress kind points to the file its just taken ages downloading (the updated version of WordPress) and says it can’t copy the file (locally, 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>

James

I'm passionate about technology, and particularly helping people make the most of it. I've spent the last 30 years helping others make the most of technology. My career started in IBM, and I've since moved into smaller business environments, to find those that have the biggest steps to take. My skills range from user based technology, through business systems (applications) to infrastructure. I also have a long background in IT security. I focus on what I consider to be "productivity technology", i.e. adding genuine value to peoples lives. I'm not a big gamer, or hold much interest in the disposable consumer technologies. During the day, you'll find me consulting with businesses or heading up an IT department. At the weekend, you'll find me sat at my Linux desktop PC, writing PHP or Python code, or trying to help others on Twitter, this blog, or my YouTube channel: Artexic.

One thought on “WordPress Upgrade Failed: Could not copy file

  • 2nd August 2011 at 7:42 am
    Permalink

    Thank you. I repost it on Google Plus
    James Peters, CA

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.