php 500 on windows server

I am working on a windows server but switching my pages  to PHP
I have in my web.config file, to show a custom 500 error page as 500.php

how can I get the error information to show up on the 500 error page.
for example, when it used to be the old .asp page, I was able to get all the error information as this :   Set objError = Server.GetLastError()
rivkamakAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David FavorLinux/LXD/WordPress/Hosting SavantCommented:
This may be difficult.

A 500 error means a Fatal exception has been raised.

To actually have a custom 500 page show depends on many factors.

This is likely best handled as a Gig, as someone will have to get into your config to determine if this is even possible.

For CMS systems like WordPress, 500 errors which occur inside the CMS, have already been hijacked by the CMS, so there's no way to serve a custom 500 error from a CMS.

If you have a .htaccess file or Web server config which has handed off a request to a CMS, then your control of content is now handled by the CMS, no longer by you.

[ ... soap box mode on ... ]

Simple way to fix this is never have 500. No code should every be deployed, in my opinion, which generates 500s. Period. Every.

I've been working with Linux + Web type systems since 1994 + I have never provided a client with code which ever produced a 500.

I'd personally push back on whoever developed this code + have them fix it + make their future pay contingent on code they returning be clean of any types of errors, including 500s.

[ ... soap box mode off ... ]
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dan McFaddenSystems EngineerCommented:
Can you post the contents of the http log where the 500 error happens.  PHP on IIS is pretty easy to implement & troubleshoot.

Dan
0
Dan McFaddenSystems EngineerCommented:
Here is the PHP error handling reference link:

http://php.net/manual/en/function.set-error-handler.php

Dan
0
rivkamakAuthor Commented:
I try to keep my code clean.
But I wanted some sort of shooting me an email with the error information if a 500 page is thrown so I can track and go back to that page.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
iis7

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.