#coding
#php
#get errors
#web development

How to get PHP errors to display

Anonymous

AnonymousJan 04, 2024

In this post, we will learn how to get php errors and display.

If display_errors is set to "Off," change it to "On."

display_errors = On

Make sure the error_reporting directive is set to a level that suits your debugging needs. This setting controls which types of errors get reported. For a development environment, it's often helpful to set it to:

error_reporting = E_ALL

Now, save your php file and restart your web server.

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// Your PHP code goes here
?>

Happy Coding! ❤️