You may have noticed that my blog has been offline for a couple of days. To be honest, I’m not sure how it happened, but I have discovered the cause. The process of fixing it may prove beneficial to others, so I’ll detail it here. Here’s what the problem looked like:
As you can see, that’s of no help. So the first thing to check was whether the blog WordPress admin pages were working. Nope, same error there. So it’s off to the trusty cPanel to check the server logs. Clicking the “Error Log” gave a lot more information:
Aha, now we’re getting somewhere:
SoftException in Application.cpp:252: File “/home/xxxxx/public_html/blog/index.php” is writeable by group
Now this makes no sense at first, what’s a SoftException and what’s a writeable group? Here’s my simple interpretation, a soft exception is an error, which in this case isn’t to do with the file contents itself, but the real clue is the “[file] is writeable by group” bit.
Writeable is a permission (like read or execute) and group is one of the 3 types of user that you can set permissions for: Owner, Group and Public. So it appears that our problem is to do with the file permissions for the index.php file, specifically that the Group set, has writeable permissions, which isn’t correct. Now it’s off to the cPanel “File Manager” to check the permissions:
You can see the permissions are set to “0777“. Don’t worry too much about this, but you do need to know that this is wrong and it should be 755 in most cases. In fact, it wasn’t just index.php that was set to 777, but every file and every folder! I can’t imagine what has caused this, but I assume it was a dodgy upgrade script. Either way, now to fix it by setting the permissions back to 755.
I use an ftp plugin for Firefox called FireFTP which allows this. Selecting all the files and folders using Ctrl+A, right clicking and selecting “Properties (incl contents)” and after a few minutes of processing, you get a permissions dialog box up:
Just untick the Write boxes against the Group and Public users, and tick the “All Contained Folders” and “All Contained Files”
Click OK and wait for a few minutes whilst Fire FTP ripples through all your files and folders resetting the permissions, and Bob’s your uncle, Internal Server errors and “is writable by group” errors are gone and the WordPress blog is back up!