php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63242 Default error page in PHP built-in web server uses outdated html/css
Submitted: 2012-10-08 17:41 UTC Modified: 2012-10-19 08:03 UTC
From: pascal dot chevrel at free dot fr Assigned: laruence (profile)
Status: Closed Package: Built-in web server
PHP Version: 5.4.7 OS: Linux
Private report: No CVE-ID: None
 [2012-10-08 17:41 UTC] pascal dot chevrel at free dot fr
Description:
------------
The default error page in the built-in webserver is very ugly. Looking at the history of the file in the git repository, these styles and html were copied from the phpinfo styling created in 2002 with CSS selectors that had Netscape 4/IE4 compatibility in mind.

Appearances matter :) It makes this new PHP feature look already outdated.

I am going to attach a patch that:
* will make it look a bit more modern and works in responsive mode too
* will remove unused css rules from the code
* will add an html5 doctype to the error page
* will remove unnecesary html attributes in html5

(I noticed that there are 2 tests in the sapi/cli/tests folder that reproduce some of this html, I don't know how tests work for php but I can give a shot at updating the expected results of the tests in the patch if required)


Patches

bug63242_struct.diff (last revision 2012-10-10 07:12 UTC by pascal dot chevrel at free dot fr)
bug63242v2 (last revision 2012-10-09 11:59 UTC by pascal dot chevrel at free dot fr)
bug63242 (last revision 2012-10-08 17:41 UTC by pascal dot chevrel at free dot fr)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-08 17:53 UTC] pascal dot chevrel at free dot fr
Here is a after/before screenshot:

http://chevrel.org/images/phpbugs/bug63242.png

Note that I chose yellow for the error header instead of blue because this is the color used in the terminal for such errors, blue is not usually an error associated to errors.
 [2012-10-09 05:12 UTC] reeze@php.net
It's nice to have modern, but the appearance should be consist on PHP 
itself(VI).

PHP use the BLUE a lot, kind of the color of PHP.

as the color yellow, It looks like an error page of django :) 

and the built-in server is just for testing purpose, If possible, I'd PHP
redesign its Visual Identity System to be more modern.

And, yes there is a PHP.net alpha there: http://www.php.net/my.php (enable it at 
the bottom).  but seems didn't active for a long time.
 [2012-10-09 08:37 UTC] pascal dot chevrel at free dot fr
Reeze, not sure I understand what you mean. For sure, I am in no way saying that the integrated web server should be used in production. 

You seem to be of the opinion that since it is not targetting production, it is ok that it is using obsolete HTML/CSS and looks like a 404 page from the 90's, I disagree, there is no reason to use complex sub-quality HTML/CSS, especially since it gives poor visual result.

My patch simplifies the code used (less lines of code) while making the error page a bit more decent in terms of layout.

I am happy to make compromises on this patch and revert the color to use the same blue color as before if you wish, using correct typography/alignment and simpler html/css code in the source code would already be a win for both consumers (web developpers that see this page during their developement) and the code base I think.
 [2012-10-09 09:34 UTC] laruence@php.net
@pascal, thanks

it will be better if you can improve the skeleton keep the "looks"
 [2012-10-09 09:34 UTC] laruence@php.net
sorry, should be:
it will be better if you can improve the skeleton, but keep the "looks"
 [2012-10-09 09:40 UTC] pascal dot chevrel at free dot fr
@laruence
Thanks, I will do that this afternoon. Is that ok if I just add back the blue background color of do you want the page to remain strictly identical to what it is now? (currently the title and paragraph are not aligned, the title also has no padding and sticks to the blue border /ex).
 [2012-10-09 12:02 UTC] pascal dot chevrel at free dot fr
I just attached an updated patch that restores the blue color.

You can see the result here:
http://chevrel.org/images/phpbugs/bug63242v2.png

I also compiled php locally and ran the tests, there were 2 tests failing because of the new patch, I updated these two tests in my patch.

Tell me if you need updates to this patch, thanks.
 [2012-10-09 14:50 UTC] reeze@php.net
@Pascal, 
I like the idea to make it more modern, I just think the color you choose it not 
well consist with PHP's blue color and visual identity.
 [2012-10-09 20:28 UTC] pascal dot chevrel at free dot fr
btw, I attached a patch to the bug but in case you prefer a Pull Request on github, just tell me. I don't know what process is preferred today for PHP patches.
 [2012-10-10 03:46 UTC] laruence@php.net
I think we can split this into two patch:
1. keep the looks unchanged, and improve the skeleton
2. improve the looks

the first one could easy to be accepted.
 [2012-10-10 07:15 UTC] pascal dot chevrel at free dot fr
Ok, here is an updated patch, it only updates the structure and tests and it reproduces the styles copied from the 2002 file. To make it absolutely identical, I had to add a margin-top:0 rule to h1 so as to emulate quirks mode in browsers for html3 documents.
 [2012-10-10 09:25 UTC] laruence@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

thanks for your help.

and you can open a new entry about improve the looks, :)

thanks
 [2012-10-10 09:25 UTC] laruence@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: laruence
 [2012-10-10 09:27 UTC] laruence@php.net
weird, no auto-commit log comments...

the commit log is here: 
https://github.com/php/php-src/commit/ea441bd08dc1d9f5bd167f3f495321c5225909b6
 [2012-10-10 09:43 UTC] pascal dot chevrel at free dot fr
Should I open a separate bug for a visual redesign of the 404 page now that this bug is closed? Or is there a discussion mailing list for such issues that I should propose the change?
 [2012-10-10 10:01 UTC] laruence@php.net
yeah, if you wish, you can open a new entry about that.
 [2012-10-19 07:41 UTC] pascal dot chevrel at free dot fr
Looking at Github branches and 5.4.8 release notes, I am not seeing the git commit on master for this bug included into the 5.4.8 release, any reason for that?
 [2012-10-19 07:47 UTC] aharvey@php.net
The fix was committed after 5.4.8 had been branched from the main 5.4 branch. (In general, fixes are only committed to release branches after RC1 for security issues or major bugs.) It will be in 5.4.9.
 [2012-10-19 08:03 UTC] pascal dot chevrel at free dot fr
Awesome, thanks :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 20:01:45 2024 UTC