Displaying PHP errors

It is possible to display PHP errors by setting display_errors flag to on in php.ini file. Please note this can be changed only for developers or QA people. In production environment this flag needs to be set to off, there is no need for customers to display a reason why application had failed.

It is also possible to display PHP errors by specifying ini_set('dispalay_errors', 1). This can be done in an environment, where there is no access to php.ini file, however it is necessary to debug PHP errors.

This setting is not global unlike settings in php.ini file, this setting applies only to a single file. If debugging information needs to be displayed in more than one file, please consider making this changes in an include file that is used across entire web site.

Comments

Popular posts from this blog

Absolute and relative path in HTML pages

Errors

goto PHP operator