These are PHP functions dealing with error handling and logging. They allow you define your own error handling rules, as well as to modify how errors can be logged. This lets you change and enhance error reporting to suit your needs.
Using these built-in functions, you can send messages directly to other machines, to an email, to system logs, and so on, hence you can selectively log and supervise the most important sections of your applications and websites.
|display_startup_errors||"0"||PHP_INI_ALL||Available since PHP 4.0.3.|
|log_errors_max_len||"1024"||PHP_INI_ALL||Available since PHP 4.3.0.|
|ignore_repeated_errors||"0"||PHP_INI_ALL||Available since PHP 4.3.0.|
|ignore_repeated_source||"0"||PHP_INI_ALL||Available since PHP 4.3.0.|
|report_memleaks||"1"||PHP_INI_ALL||Available since PHP 4.3.0.|
|html_errors||"1"||PHP_INI_ALL||PHP_INI_SYSTEM in PHP <= 4.2.3. Available since PHP 4.0.2.|
|docref_root||""||PHP_INI_ALL||Available since PHP 4.3.0.|
|docref_ext||""||PHP_INI_ALL||Available since PHP 4.3.2.|
|warn_plus_overloading||NULL||This option is no longer available as of PHP 4.0.0|
List of Error Handling Functions
|Sr.No||Advanced & Description||PHP|
Generates a backtrace
Prints a backtrace
Gets the last error occurred
Sends an error to the server error-log, to a file or to a remote destination
Specifies which errors are reported
Restores the previous error handler
Restores the previous exception handler
Sets a user-defined function to handle errors
Sets a user-defined function to handle exceptions
Creates a user-defined error message
Alias of trigger_error()
Error Handling Constants
You can make use of any of the constants while configuring your php.ini files.
|Value||Constant & Description||PHP|
Fatal run-time errors. Errors that cannot be recovered from. Execution of the script is halted
Non-fatal run-time errors. Execution of the script is not halted
Compile-time parse errors. Parse errors should only be generated by the parser
Run-time notices. The script found something that might be an error, but could also happen when running a script normally
Fatal errors at PHP startup. This is like an E_ERROR in the PHP core
Non-fatal errors at PHP startup. This is like an E_WARNING in the PHP core
Fatal compile-time errors. This is like an E_ERROR generated by the Zend Scripting Engine
Non-fatal compile-time errors. This is like an E_WARNING generated by the Zend Scripting Engine
Fatal user-generated error. This is like an E_ERROR set by the programmer using the PHP function trigger_error()
Non-fatal user-generated warning. This is like an E_WARNING set by the programmer using the PHP function trigger_error()
User-generated notice. This is like an E_NOTICE set by the programmer using the PHP function trigger_error()
Run-time notices. PHP suggest changes to your code to help interoperability and compatibility of the code
Catchable fatal error. This is like an E_ERROR but can be caught by a user defined handle (see also set_error_handler())
All errors and warnings, except of level E_STRICT
Do feel free to ask your questions where necessary and we will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.
Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.
Thanks for reading and bye for now.