{"id":489,"date":"2011-06-12T16:43:00","date_gmt":"2011-06-12T16:43:00","guid":{"rendered":"https:\/\/www.geekmungus.co.uk\/?p=489"},"modified":"2022-11-05T10:53:43","modified_gmt":"2022-11-05T10:53:43","slug":"php-500-error-on-iis","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=489","title":{"rendered":"PHP 500 Error on IIS"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">There are many causes of a 500 error on PHP pages on IIS. But this was a little bit of a weird one, when trying to make some php pages work they all generated 500 errors. I created a test php page which worked fine, just all the scripts didn&#8217;t so I checked through the ratsnest of scripts to find all sorts of cut and paste going on.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One thing i did notice was the use of short PHP tags, this is not recommended as it makes the scripts less portable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In php.ini all I had to do was change the line:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">short_open_tag = Off<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">short_open_tag = On<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And then restart IIS, this fixed the problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also handy is to enable displaying of errors with:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">display_errors = On<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are many causes of a 500 error on PHP pages on IIS. But this was a little bit of a weird one, when trying to make some php pages work they all generated 500 errors. I created a test php page which worked fine, just all the scripts didn&#8217;t so I checked through the &#8230; <a title=\"PHP 500 Error on IIS\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=489\" aria-label=\"Read more about PHP 500 Error on IIS\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-489","post","type-post","status-publish","format-standard","hentry","category-microsoft-windows"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=489"}],"version-history":[{"count":1,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/489\/revisions"}],"predecessor-version":[{"id":1585,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/489\/revisions\/1585"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}