Posted on Leave a comment

WordPress: Internal Server Error (500) after moving to new location

You follow the official WordPress migration documentation and still end up with the dreaded internal server error. This little incident launches you into panic mode. You spend the next 30-60 mins googling a fix for this godforsaken situation. Most of the solutions you come across mention something about fixing/deleting your .htaccess file. Alas, that doesn’t work for you. Not even disabling all plugins. What do you do?

Chances are your WordPress installation’s file permissions are screwed, as happened with me during my recent spring cleaning. After wasting some time googling for solutions, I ended up realizing that file permissions for all my WP files were reset to 640 (-rw-r—–). And I had only moved my installation to another directory on the same server. None of the solutions that I came across on Google talked about file permissions as a potential problem. So I thought I’d share this little fix.

The fix is simple. If you have access to your web server via ssh, you can execute the two commands mentioned on Hardening WordPress page.

find /path/to/your/wordpress/install/ -type d -exec chmod 755 {} \;

find /path/to/your/wordpress/install/ -type f -exec chmod 644 {} \;

Otherwise, manually change the permissions via an FTP client.