# [PATCH] Repost: html_errors more readable

- Thread: https://externals.io/message/3730
- Original archive: https://news-web.php.net/php.internals/3730
- Started by Stefan Walk on 2003-08-05T07:14:48+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #3730 — Stefan Walk — 2003-08-05T07:14:48+00:00

URL: https://externals.io/message/3730#3730

Hi,

A while ago I proposed a patch that improved html_errors, but i got no
response from that, so i repost an improved version...

The patch changes they way errors are displayed:
1) They are readable. 
   The current version prints in black with no background at all,
   sometimes leading to black error messages on dark backgrounds - not
   very readable. Additionally, they have a fixed font size so they
   don't appear in a 4px font somewhere.
2) They are colorized.
   Notices, warnings, fatal errors and other errors get distinct colors
   for a better quick overview.
3) They look better ;)
   It uses CSS to format the error message nicely.

The colors used are changeable by php.ini directives.

Since many people just debug in their browser without using own
error_handlers or append/prepend_strings, i think this is a nice
addition that makes php more user-friendly.

An example of how this looks can be found at:
http://prp0.prp.physik.tu-darmstadt.de/~swalk/errors.htm

Regards
Stefan

---

## #3732 — Jani Taskinen — 2003-08-05T12:32:54+00:00

URL: https://externals.io/message/3730#3732 · In reply to: #3730

Why don't you just use the existing ini options:
        
    ; String to output before an error message.
    ;error_prepend_string = "<font color=ff0000>"
    
    ; String to output after an error message.
    ;error_append_string = "</font>"
    
    ??
    
    --Jani
    



>Hi,
>
>A while ago I proposed a patch that improved html_errors, but i got no
>response from that, so i repost an improved version...
>
>The patch changes they way errors are displayed:
>1) They are readable. 
>   The current version prints in black with no background at all,
>   sometimes leading to black error messages on dark backgrounds - not
>   very readable. Additionally, they have a fixed font size so they
>   don't appear in a 4px font somewhere.
>2) They are colorized.
>   Notices, warnings, fatal errors and other errors get distinct colors
>   for a better quick overview.
>3) They look better ;)
>   It uses CSS to format the error message nicely.
>
>The colors used are changeable by php.ini directives.
>
>Since many people just debug in their browser without using own
>error_handlers or append/prepend_strings, i think this is a nice
>addition that makes php more user-friendly.
>
>An example of how this looks can be found at:
>http://prp0.prp.physik.tu-darmstadt.de/~swalk/errors.htm
>
>Regards
>Stefan
>

-- 
https://www.paypal.com/xclick/business=sniper@php.net&no_note=1&tax=0&currency_code=EUR

---

## #3733 — Jani Taskinen — 2003-08-05T12:39:19+00:00

URL: https://externals.io/message/3730#3733 · In reply to: #3732

Nevermind, I should learn to read..you wanted to have different
    colors for different messages..
    
    --Jani
    



>
>    Why don't you just use the existing ini options:
>        
>    ; String to output before an error message.
>    ;error_prepend_string = "<font color=ff0000>"
>    
>    ; String to output after an error message.
>    ;error_append_string = "</font>"
>    
>    ??
>    
>    --Jani
>    
>
>
>
> > […]
>
>

-- 
https://www.paypal.com/xclick/business=sniper@php.net&no_note=1&tax=0&currency_code=EUR

---

## #3734 — Stefan Walk — 2003-08-05T13:07:45+00:00

URL: https://externals.io/message/3730#3734 · In reply to: #3732

>     Why don't you just use the existing ini options:
>         
>     ; String to output before an error message.
>     ;error_prepend_string = "<font color=ff0000>"
>     
>     ; String to output after an error message.
>     ;error_append_string = "</font>"
>     
>     ??
>     
>     --Jani

This patch is not for me, I don't debug in my browser. While helping
others writing PHP,  the conversation "What error message?"
"There is none, look for yourself, http://..." was not rare, because the
error message was hidden somewhere.

Changing the default to display it in a well-formatted way would be
helpful for beginners, in my - and most people i asked about this -
opinion.

When changing append/prepend strings, they get outputted also when
html_errors is off, so putting html in them is not a good thing imo.
(Also, distinct colors are not possible by doing that).

Regards,
Stefan Walk
