How to make PHP display the error instead of giving 500 Internal Server Error?

Spread the love

Sometimes, we want to make PHP display the error instead of giving 500 Internal Server Error.

In this article, we’ll look at how to make PHP display the error instead of giving 500 Internal Server Error.

How to make PHP display the error instead of giving 500 Internal Server Error?

To make PHP display the error instead of giving 500 Internal Server Error, we call error_reporting with E_ALL.

For instance, we write

error_reporting(E_ALL);
ini_set('display_errors', 'On');

to call error_reporting with E_ALL to report all errors.

Then we call ini_set with 'display_errors and 'on' to display all errors.

Conclusion

To make PHP display the error instead of giving 500 Internal Server Error, we call error_reporting with E_ALL.

Leave a Reply

Your email address will not be published. Required fields are marked *