What are the different types of errors in php

PHP (Hyper teWhat are the different types of errors in phpxt Pre Processor) is a scripting language commonly used for web applications. PHP can be easily embedded in HTML. PHP generally runs on a web server. It is available for free and can be used across a variety of servers, operating systems and platforms. let’s see What are the different types of errors in php

What are the different types of errors in php?

These error report levels are the different types of error the user-defined error handler can be used for :

  • E_ERROR : A fatal error that causes script termination
  • E_WARNING : Run-time warning that does not cause script termination
  • E_PARSE : Compile time parse error.
  • E_NOTICE : Run time notice caused due to error in code
  • E_CORE_ERROR : Fatal errors that occur during PHP’s initial startup (installation)
  • E_CORE_WARNING : Warnings that occur during PHP’s initial startup
  • E_COMPILE_ERROR : Fatal compile-time errors indication problem with script.
  • E_USER_ERROR : User-generated error message.
  • E_USER_WARNING : User-generated warning message.
  • E_USER_NOTICE : User-generated notice message.
  • E_STRICT : Run-time notices.
  • E_RECOVERABLE_ERROR : Catchable fatal error indicating a dangerous error
  • E_ALL : Catches all errors and warnings To enable PHP error logging,

you can add the following directives either to the global php.ini file of your hosting account, or to a php.ini file in the folder where you want error logging enabled:

log_errors = On display_errors = Off error_log = error_log OR error_log = /home/%USER%/public_html/errors_log

Enjoy 🙂

Tagged , , , . Bookmark the permalink.