When installing PHP in Windows 2008 Server R2, you might find that Windows IIS 7 returns error code 500 when executing scripts. To resolve this do two things:
1) browse to the folder that contains the script with the error using CMD. Yes, this is the command prompt.
Then execute the script using something like: "C:\Program Files\PHP\PHP5.4\php.exe" [script-filename].php
Note that the quotes ("") are needed for file paths with spaces.
This will return the results of the script and any errors you might have.
2) To have IIS 7 return the errors to your webbrowser, turn off error logging and turn on display errors. And to make sure that all the errors are display, set error reporting to ALL.
log_errors = Off
display_errors = On
error_reporting = E_ALL