WordPress Upgrade Error
WordPress, by default, offers you an easy way to upgrade your WordPress Core by using the ‘Automatically Upgrade’ button that you can find in homepage/Dashboard of your administrator backend. When you use this Automatic Upgrade, you might often end up with a failed installation notice that reads “Could not copy file: /public_html/../wp-content/upgrade/core/wordpress/wp-comments-post.php” or a similar error notice with a text “Installation Failed!”. WordPress basically downloads the upgraded core from its server, unpacks it to the temporary ‘upgrade’ folder and then copies those stuff to the root directory where your WP Core resides.
When you land on a similar problem as shown above, all you have to do is to delete the folder ‘upgrade’ or its contents and try installing again. Or if you prefer to just rename it, you can do so.
If you are on a VPS/Dedicated Server or have access to SSH, you can just SSH into the WP Core Directory and remove/rename the ‘upgrade’ folder.
For FTP users
If you have access to FTP, login using your FTP account, browse to ‘wp-content’ and remove/rename the folder ‘upgrade’.
For cPanel users
If your host offers cPanel Control Panel, login to your cPanel by typing www.yourdomain.com:2083. Under ‘Files’ category, click ‘File Manager’. Choose to open your blog folder. Double-click ‘wp-content’, right click ‘upgrade’ and choose delete/rename.
If your host doesn’t offer cPanel or has a custom panel, you should be able to find ‘File Manager’ somewhere inside your Custom Panel. Remove/rename the ‘upgrade’ folder in ‘wp-content’.
After you have removed the ‘upgrade’ folder, try upgrading once again using the ‘Automatically Upgrade’ feature. If you have used Automated Script Installers like Fantastico/Installatron/Softaculous, use the Upgrade feature available there. That should upgrade your WordPress flawlessly.