I have a page written in PHP. I do not have access to the server. I'd like to make so that instead of showing an error message when PHP encounters an error, it gives a 500.
Asked
Active
Viewed 916 times
3
-
1@Darin Dimitrov: I think OP is referring to the HTTP Status code 500. – PeeHaa Sep 04 '11 at 19:22
2 Answers
4
PHP 5.2 by default sends HTTP 500 in case of fatal error, if display_errors is off. If the hosting is with older PHP, you have to register your own error handler and possibly exception handler and redirect the user to your 500 error page. Try setting the display_errors and error_reporting variables in your PHP script as @Umang suggested.

Maxim Krizhanovsky
- 26,265
- 5
- 59
- 89
2
you can create your own error handler and use it to send 503 status code to the client.

Your Common Sense
- 156,878
- 40
- 214
- 345