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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vitaliy dot okulov at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 16:01:37 2025 UTC