Display PHP Errors

PHP Error Display Setting: 

If we need to be experienced developer, it’s very important to work with errors and working.
This always helps us to write errors less code. 

Then it’s very important to write proper error handing code, but I always prefer error handing code on live environment and not on development or test environment.

Sometime error are displaying in PHP this could be due to you have implementing error suppress code or another silly reason that we are looking in other function.

Use below code that will help to show the error on your PHP code or file.

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);

The above code will display error on your PHP file. In case error are still not displaying , you have to check the php.ini configuration . You have to check PHP file configuration.
Make below change to reflate error on page.

File Name: php.ini
Change needed:  display_errors = on

In case you are still facing issue with this code , please make a comment and add your any suggestions.

1 comment :

Tech IT Solutions said...

Coding was one of my major weaknesses back when I had computing. But this article proved to be of great understanding. I would like you to add more illustrations to support your explanations. They are of great help when words aren't enough.