Usually in default errors are disabled for production. Sometimes you have error 500 for an example and you need to see the error message. For an example in Drupal 7 you can put this in settings.php. But this applies on any php cms or any other script.
Source code viewerProgramming Language: PHP