How do I display the PHP errors?

In this tutorial, we are going to learn. How we can display the different PHP errors in PHP files. if due to some reason not showing or disabled.

Bellow code you need to add to your PHP code file Top list after starting the <?php

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

However, this doesn’t make PHP to show parse errors – the only way to show those errors is to modify your php.ini with this line:

display_errors = on

(if you don’t have access to php.ini, then putting this line in .htaccess might work too):

php_flag display_errors 1