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');
error_reporting(E_ALL);
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
Hello Friends, I’m Mohit Sharma founder of tutrialwala.com, Full Stack Web Developer. Expertise in WordPress, PHP, Laravel, Angular, and Frontend Development. In this publication, I share everything I know about PHP frameworks and Javascript frameworks, packages, and tools.
Have a project in mind? Get in touch