2

When Apache shows 500 Internal Server Error page, there is no information about the error itself. It can be error in .htaccess or something different, but you'll never know until you look into error.log.

Is it possible to display error message immediately in the browser?

cronfy
  • 691
  • 1
  • 6
  • 14
  • The target audience here generally does not want to display such messages in browser, as they could be security sensitive. For development, your programming framework may provide a solution, but we would not know about the specifics. – Michael Hampton Dec 02 '17 at 20:35
  • 1
    Sometimes recursive redirections and Apache misconfiguration result in a error 500 that is not the cause of any programming framework, and as such, can only be debugged with information that is only available on error.log. I think this question is useful for a development environment. – vicenteherrera May 18 '18 at 10:47
  • Try this: Tell us then how it was. – Diego Graziano Sep 06 '19 at 22:15
  • @DiegoGraziano I do not have mod_php in my Apache. In question I told about errors like ones from .htaccess, which occur before any programming language module in apache would get control. – cronfy Sep 10 '19 at 09:04
  • Can we get an answer to this? As a developer, I'm working with a Python framework that is highly volatile and throws unexpected errors during development. I'd rather see Apache Error Log messages dumped straight to the browser in the development environment. – JamesHoux Aug 01 '22 at 16:51

1 Answers1

0

As far as I'm aware, there's no built-in way to tell Apache to simply dump error log messages directly to the browser. I'm betting the error_log output happens in an independent part of the Apache pipeline -- just a guess.

Most of the time when someone wants output errors directly to the browser, that person is a developer working in a web script such as PHP, Python, Perl, or other lang. In order to output error messages that occur within your lang interpretter, you have to format the output and pass it through apache as if it was normal output.

PHP

Some languages provide an easy way to do this, such as the well known error_reporting switch in PHP.

Python

Unfortunately some languages, make this painful or almost impossible and Python is one of them.

At one time this was apparently possible using https://docs.python.org/3/library/cgitb.html

However that library has been deprecated. Seems like the Python community doesn't have much love for developers who want to get immediate feedback about errors in the browser. :(

JamesHoux
  • 257
  • 1
  • 3
  • 8