All of the following commands must be run in the C:\Windows\System32\inetsrv folder
This command enables pass through of error messages from PHP-FastCGI to IIS when running PHP sites, rather than just throwing a generic 500 message when something goes wrong. Replace sitename with the name of the site in IIS.
appcmd.exe set config "sitename" -section:system.webServer/httpErrors /existingResponse:"PassThrough" /commit:apphost