3

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.

1
  • 1
    @Darin Dimitrov: I think OP is referring to the HTTP Status code 500. Commented Sep 4, 2011 at 19:22

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

2

you can create your own error handler and use it to send 503 status code to the client.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.