Updating WordPress is always easy but I faced many issues lately, after transferring my blog to Unmanaged VPS, I wasn’t able to update any plugins and core by auto update method. Mostly this issue occurs due to file permission either on Shared or on VPS.
Auto Update failure shows the message:-
Sometimes after update failed your site will show Maintenance Page.
“Briefly unavailable for scheduled maintenance. Check back in a minute”.
How to Remove Maintenance Page Message on WordPress?
Maintenance page appeared when updating failed due to any reason either due to “server script timeout” or any other reason. Your site will be resumed within 10 minutes but if you want your site back immediately access your root directory using FTP or SSH and remove/delete the file .maintenance
There is also a manual method to update WordPress core and plugin you can read here, but if you want to update automatically then first you should contact your hosting provider.
How to Fix WordPress Auto Update Failed on VPS?
For Shared hosting:
- Contact your hosting provider as I said above, at least they will tell you the reason in most cases they will fix for you because they are committed to supporting you.
- You can change the file permission temporarily to 777 for the desired plugin or themes, Open the home directory via FTP or SSH
- //public_html/ >>> Check the file permission of the folder and files inside the wp-contents, mostly permission on the folder is 755/750 and permission for all files will be 644.
- Change the file permission of wp-contents to 777 via filezilla and tick the Recurse into sub directories and tick all file and directories.
- After updating change back the file permission of all folder to 755/750 and 644 for all files by same method this time you have to tick apply to all files and all directories by two separate operation.
Note: Use this method only if you are sure you want to change the file permission to 777 because messing with permission may cause security issues and if you are using this method you must change back the permission as it was earlier.
For Virtual Private Server or VPS User:
- VPS Users can also do the above method or also via SSH.
- Open the putty >>> Login as root and run this command (/home/wordpress – is my directory name you can have the different directory name for your site)
chown -R www-data:www-data /home/wordpress
For Nginx Server, you need to execute above command differently,
chown -R nginx:nginx /home/wordpress
It will fix the ownership of all the files and directories in /home/wordpress to the www-data user so that WordPress can overwrite its files when updating
How To Fix Permalink in WordPress On VPS:-
To fix permalinks:
1) Enable Mod Rewrite : sudo a2enmod rewrite (dont use sudo if you logined as root)
2) Change AllowOverride None to AllowOverride All : sudo nano /etc/apache2/sites-enabled/000-default
3) Restart Apache/Nginx : service apache2 restart/service nginx restart