Errors and IIS 7

Hello all, sorry to start off my Yii forum experience with a plea for help but I can’t figure out how to make Yii display errors correctly on IIS 7. Every error thrown manages to create a generic “There is a problem with the resource you are looking for, and it cannot be displayed.” Internal Server Error 500.

If I set the log to write to the file I can still retrieve the stack trace and problem but I would really like to be able to see Yii’s error screens. I’ve also noticed that normal errors (such as including a non-existent file) also manage to throw server 500 errors but only when done through yii. This makes me think there’s something not working between the server and yii’s error throwing system.

Thanks in advance and let me know if I need to give more info on anything.

Nevermind I managed to fix it. For some reason whenever you set an error header on IIS it automatically stops right there and displays its generic error page. I extended the CErrorHandler Class, copied the private _error, handleError(), and handleException() over to my new YErrorHandler and deleted the part where it sent the headers and everything seems to be working fine. R.I.P. headers.

Last time I ran into this it turned out there was an IIS setting that could be changed that would allow you to see the PHP errors. Sorry, don’t remember what it was, but you shouldn’t have to go to the trouble of overriding CErrorHandler to get this working …