1. Home
  2. PHP
  3. Displaying errors on-screen for debugging

Displaying errors on-screen for debugging

Overview

During early development of a PHP application or to debug a problem, errors should be displayed in-browser to help spot typos, undefined variables, misconfiguration, and other logic flaws.

Solution

Enable display_errors and increase verbosity in error_reporting within PHP. As an example, configuration within a .htaccess  would be:

php_flag display_errors On
php_value error_reporting 9999999

Caveats

Some applications may use a separate configuration value to enable/disable debugging. This in turn will toggle the above settings on or off within the application through ini_set. Refer to your application’s manual for specific instructions.

Common Applications

Updated on July 8, 2019

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help! If you get an error, visit https://lithiumhosting.com/support instead.
Contact Support