|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71276 Built-in webserver does not send Date header
Submitted: 2016-01-04 17:04 UTC Modified: 2016-06-02 11:19 UTC
Avg. Score:3.0 ± 1.1
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:1 (25.0%)
From: me at derrabus dot de Assigned: ab (profile)
Status: Closed Package: Built-in web server
PHP Version: 7.0.1 OS: OS X
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
6 + 8 = ?
Subscribe to this entry?

 [2016-01-04 17:04 UTC] me at derrabus dot de
According to RFC 7231, the Date header is mandatory for HTTP responses. It should contain "the best available approximation of the date and time of message generation".

Usually, it's the webserver's task to add this header. For instance, the header is magically present in responses coming from an Apache webserver with mod_php.

PHP's build-in webserver on the other hand does not add that header.

Strangely enough, it sends a Host header with the response (copied from the request), although that header is afaik a request-only header.

Test script:
php -S localhost:8080 any-script.php

Expected result:
GET / HTTP/1.1
Host: localhost

HTTP/1.1 200 OK
Date: Mon, 04 Jan 2016 16:36:54 GMT
Content-type: text/html; charset=UTF-8

<!-- The actual content -->

Actual result:
GET / HTTP/1.1
Host: localhost

HTTP/1.1 200 OK
Host: localhost
Connection: close
X-Powered-By: PHP/7.0.1
Content-type: text/html; charset=UTF-8

<!-- The actual content -->


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-02 11:19 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2016-06-02 11:19 UTC]
PR merged.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 01 15:01:30 2024 UTC