{"id":472,"date":"2009-03-22T12:31:05","date_gmt":"2009-03-22T12:31:05","guid":{"rendered":"http:\/\/www.colinmcnulty.com\/blog\/?p=472"},"modified":"2009-03-22T12:31:05","modified_gmt":"2009-03-22T12:31:05","slug":"recovering-from-internal-server-errors","status":"publish","type":"post","link":"https:\/\/www.colinmcnulty.com\/blog\/2009\/03\/22\/recovering-from-internal-server-errors\/","title":{"rendered":"Recovering from Internal Server Errors"},"content":{"rendered":"<p>You may have noticed that my blog has been offline for a couple of days.  To be honest, I&#8217;m not sure how it happened, but I have discovered the cause.  The process of fixing it may prove beneficial to others, so I&#8217;ll detail it here.  Here&#8217;s what the problem looked like:<\/p>\n<img loading=\"lazy\" alt=\"\" src=\"\/blog\/images\/ise-internal-server-error.jpg\" title=\"Internal Server Error 500\" class=\"aligncenter\" width=\"605\" height=\"334\" \/>\n<p>As you can see, that&#8217;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&#8217;s off to the trusty cPanel to check the server logs.  Clicking the &#8220;Error Log&#8221; gave a lot more information:<\/p>\n<img loading=\"lazy\" alt=\"\" src=\"\/blog\/images\/ise-cpanel-error-log.jpg\" title=\"cPanel Error Log\" class=\"aligncenter\" width=\"1026\" height=\"300\" \/>\n<p>Aha, now we&#8217;re getting somewhere: <\/p>\n<p><em>SoftException in Application.cpp:252: File &#8220;\/home\/xxxxx\/public_html\/blog\/index.php&#8221; is writeable by group<\/em><\/p>\n<p>Now this makes no sense at first, what&#8217;s a SoftException and what&#8217;s a writeable group?  Here&#8217;s my simple interpretation, a soft exception is an error, which in this case isn&#8217;t to do with the file contents itself, but the real clue is the <em>&#8220;[file] is writeable by group&#8221;<\/em> bit.  <\/p>\n<p><strong>Writeable <\/strong>is a permission (like read or execute) and <strong>group <\/strong>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&#8217;t correct. Now it&#8217;s off to the cPanel &#8220;File Manager&#8221; to check the permissions:<\/p>\n<img loading=\"lazy\" alt=\"\" src=\"\/blog\/images\/ise-file-permissions.jpg\" title=\"File Permisions - Owner, Group, Public\" class=\"alignnone\" width=\"330\" height=\"25\" \/>\n<p>You can see the permissions are set to &#8220;<strong>0777<\/strong>&#8220;.  Don&#8217;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&#8217;t just index.php that was set to 777, but every file and every folder!  I can&#8217;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.<\/p>\n<p>I use an ftp plugin for Firefox called <a href=\"http:\/\/fireftp.mozdev.org\/\">FireFTP<\/a> which allows this.  Selecting all the files and folders using Ctrl+A, right clicking and selecting &#8220;<strong>Properties (incl contents)<\/strong>&#8221; and after a few minutes of processing, you get a permissions dialog box up:<\/p>\n<img loading=\"lazy\" alt=\"\" src=\"\/blog\/images\/ise-fireftp.jpg\" title=\"Fire FTP\" class=\"aligncenter\" width=\"586\" height=\"398\" \/>\n<p>Just untick the <strong>Write <\/strong>boxes against the <strong>Group <\/strong>and <strong>Public <\/strong>users, and tick the &#8220;<em>All Contained Folders<\/em>&#8221; and &#8220;<em>All Contained Files<\/em>&#8221;<\/p>\n<img loading=\"lazy\" alt=\"\" src=\"\/blog\/images\/ise-fireftp2.jpg\" title=\"Fire FTP Firefox plugin\" class=\"aligncenter\" width=\"586\" height=\"398\" \/>\n<p>Click OK and wait for a few minutes whilst Fire FTP ripples through all your files and folders resetting the permissions, and Bob&#8217;s your uncle, <strong>Internal Server errors<\/strong> and &#8220;<strong>is writable by group<\/strong>&#8221; errors are gone and the WordPress blog is back up!  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may have noticed that my blog has been offline for a couple of days. To be honest, I&#8217;m not sure how it happened, but I have discovered the cause. The process of fixing it may prove beneficial to others, so I&#8217;ll detail it here. Here&#8217;s what the problem looked like: As you can see, [&hellip;]<\/p>\n","protected":false},"author":161,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[11,10],"_links":{"self":[{"href":"https:\/\/www.colinmcnulty.com\/blog\/wp-json\/wp\/v2\/posts\/472"}],"collection":[{"href":"https:\/\/www.colinmcnulty.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.colinmcnulty.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.colinmcnulty.com\/blog\/wp-json\/wp\/v2\/users\/161"}],"replies":[{"embeddable":true,"href":"https:\/\/www.colinmcnulty.com\/blog\/wp-json\/wp\/v2\/comments?post=472"}],"version-history":[{"count":0,"href":"https:\/\/www.colinmcnulty.com\/blog\/wp-json\/wp\/v2\/posts\/472\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.colinmcnulty.com\/blog\/wp-json\/wp\/v2\/media?parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.colinmcnulty.com\/blog\/wp-json\/wp\/v2\/categories?post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.colinmcnulty.com\/blog\/wp-json\/wp\/v2\/tags?post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}