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’t so I checked through the ratsnest of scripts to find all sorts of cut and paste going on.
One thing i did notice was the use of short PHP tags, this is not recommended as it makes the scripts less portable.
In php.ini all I had to do was change the line:
short_open_tag = Off
short_open_tag = On
And then restart IIS, this fixed the problem.
Also handy is to enable displaying of errors with:
display_errors = On