php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35546 Content-Length
Submitted: 2005-12-04 18:27 UTC Modified: 2005-12-05 18:09 UTC
From: vitaliy dot okulov at gmail dot com Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 5.1.1 OS: Linux
Private report: No CVE-ID: None
 [2005-12-04 18:27 UTC] vitaliy dot okulov at gmail dot com
Description:
------------
Content-Length bug with php scripts.
I create simple script. Then just send HEAD request to my WebServer:

HEAD -aUuSsx 'http://blabla/media/test2.php'
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: HEAD http://blabla/media/test2.php
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::UserAgent::request: Simple response: OK
HEAD http://blabla/media/test2.php
User-Agent: lwp-request/2.06

As you see there is no Content-Length field. But if i request .html file or something other like gif or jpeg i can see Content-Length header in response.

Reproduce code:
---------------
<?
phpinfo();
?>


Expected result:
----------------
HEAD http://blabla/media/test2.php --> 200 OK
Connection: close
Date: Sun, 04 Dec 2005 16:56:31 GMT
Server: Apache
Content-Language: ru
Content-Length: 17
Content-Type: text/html
Client-Date: Sun, 04 Dec 2005 16:56:31 GMT
Client-Peer: 10.0.0.1:80
Client-Response-Num: 1

Actual result:
--------------
HEAD http://blabla/media/test2.php --> 200 OK
Connection: close
Date: Sun, 04 Dec 2005 16:56:31 GMT
Server: Apache
Content-Language: ru
Content-Type: text/html
Client-Date: Sun, 04 Dec 2005 16:56:31 GMT
Client-Peer: 10.0.0.1:80
Client-Response-Num: 1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-04 22:08 UTC] tony2001@php.net
That's because HTML pages are static, but PHP are dynamic ones and neither Apache, nor PHP can't tell you the lenght of the page before it gets out.
 [2005-12-05 18:09 UTC] jorton@php.net
Actually it's a 2.x bug, see:

http://issues.apache.org/bugzilla/show_bug.cgi?id=18757

for a patch.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Mar 23 22:01:25 2019 UTC