Executing a PHP file can result in an error and there are cases when you don't get any information about the things that went wrong in the process as you could see a blank page or any weird things on the browser. This page explains how to display errors in PHP.
How to display errors in PHP?
These errors are logged in the PHP log file or the server log file, but you can simply make changes to your code to quickly view it on the browser.
ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
These variables are normally defined in your php.ini file. The above lines `ini_set()` is basically overriding these configuration options in your code.
The value of display_errors decides if the errors should be displayed to the user or hidden from it.
The above variable does not display the errors which occur during the PHP's startup sequence. To display them, you need to enable display_startup_errors directive.
||Fatal run-time errors|
||Run-time warnings (non-fatal errors).|
The code execution found something that needs to be noticed by the developer. This could result in an error.
||All errors and warnings|
More options can be found at https://www.php.net/manual/en/errorfunc.constants.php