Fixed issue #2515: PHP error handling too weak

The script is halted and a '500 Internal Server Error' is issued when a fatal error occurs.

Signed-off-by: Jesse van Assen <jesse.v.assen@gmail.com>