When you are running a local copy of WordPress in a MAMP development environment on your Mac, you might have run into troubles with WordPress being “stuck” in maintenance mode after trying to update WordPress (plugins, themes or core updates).
Why is this & how can you get WordPress out of maintenance?
As soon as you click “update” in the WordPress admin interface locally, it creates a
.maintenance file in the root folder of your WordPress site. This is to switch globally into a maintenance mode while WordPress tries to update the files for whatever updates you selected.
The updates being stuck in maintenance mode could be because WordPress cannot add, remove and update the files in the MAMP
/htdocs/ folder: and this might be caused by wrong file access permissions.
How to fix updating of a local WordPress installation
In order to fix this – and have your precious WordPress updates run through smoothly again locally – use the following command with the
Terminal.app in macOS:
$ cd /Applications/MAMP/htdocs/YOUR-WORDPRESS-SITE/ $ chmod -R 777 ./wp-content/uploads ./wp-content/plugins ./wp-content/themes ./wp-content/upgrade
…and don’t forget to delete the
.maintenance file from your WordPress root folder!
By the way: above command may also fix an issue you may be experiencing when errors pop up while uploading Media files to your WordPress site locally.
Warning: don’t “chmod 777” on your live WordPress site!
This will cause a security risk on your productive webserver, because it makes it much easier for people with bad intentions to upload a malicious script into a folder that has been chmod’ed with 777 and thus take control of the whole system.
Don’t to this on a live webserver!