0

We have an old php instance running on a server. php 5.1.6 precisely. But it is handling all payments and some other critical stuff so there is no plan of upgrading it as of now. There are a couple of crons running. The requirement is to catch fatal errors. However as we know, function error_get_last which does the job of gathering error information, was not available in that version of php.

I have scoured the web for any method of catching the fatal error, but have not succeeded yet. There is a way to do that mentioned by someone here http://php.net/manual/en/function.error-get-last.php, however that did not work. Please help.

Shades88
  • 7,934
  • 22
  • 88
  • 130
  • You can't catch fatal errors; you can register a shutdown function, but you'd have to implement your own logic to detect whether the error took place. – Ja͢ck Sep 02 '13 at 06:07
  • 1
    How about monitoring PHP error log? This is the only way to detect parse errors. – Lauris Sep 02 '13 at 06:08
  • Parse errors shouldn't happen for critical code like that, you can write this into a deployment script. – Ja͢ck Sep 02 '13 at 06:09
  • No not parse error, that is too primary. We are facing db connection and some other unidentifiable issues. So to know them and let developers know when it happens I need to catch it and send a mail to dev team with relevant error information. – Shades88 Sep 02 '13 at 06:33

0 Answers0