php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40472 Semi random characters posted along with page content
Submitted: 2007-02-14 02:59 UTC Modified: 2007-02-15 09:16 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: fuitad at gmail dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.2.1 OS: FreeBSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: fuitad at gmail dot com
New email:
PHP Version: OS:

 

 [2007-02-14 02:59 UTC] fuitad at gmail dot com
Description:
------------
Since we have upgraded our servers to PHP 5.2.1, some of our websites (Across 5 servers, using either Apache or Lighttpd) shows semi random characters at the top of each page and sometimes, also in other locations in the page content.

Just to make this even harder to debug, it only happens for people who are connecting to our servers thru a proxy.

For example, if you open www.fuitad.com via http://www.rexswain.com (Rex Swain's HTTP Viewer), you will see:

43a2(CR)(LF)
<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">(LF)

Now, obvioustly, this is not normal.

The same error happens if you look at the following websites via the Rex Swain HTTP Viewer (or behind your favorite proxy):

www.zestuff.com
www.vgcats.com
www.nuklearpower.com
www.cad-comic.com

Again, this does not happen to everybody. We think it only occurs for people behind a proxy.

I tried recompiling PHP numerous times 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-14 07:49 UTC] mike@php.net
You're seeing HTTP/1,1 chunked transfer encoding. If your proxy cannot understand HTTP/1.1 then it should send HTTP/1.0 requests.

I can't see anything unusual here.
 [2007-02-14 13:56 UTC] fuitad at gmail dot com
Ok, this is a nice explanation but our proxy servers (either ours or the Rex Swain HTTP Viewer) did not have that problem before PHP 5.2.1 and we also don't have this problem when we send out HTTP/1.1 requests to other servers. I'm pretty positive that this bug is not on the browser's end.

I beg you to look again and see if it could be something else.
 [2007-02-14 15:04 UTC] mike@php.net
Seems that your Apache serves HTTP/1.1 chunked encoded responses despite receiving HTTP/1.0 requests.

Did you upgrade your Apache installation too?
 [2007-02-14 15:12 UTC] fuitad at gmail dot com
[fmg@ib-apache1 ~]$ httpd -v
Server version: Apache/2.2.4 (FreeBSD)
Server built:   Feb 12 2007 22:00:05

[fmg@IB-LIGHTTPD1 ~]$ lighttpd -v
lighttpd-1.4.13 (ssl) - a light and fast webserver
Build-Date: Feb 12 2007 21:46:29
 [2007-02-14 15:27 UTC] mike@php.net
So, I don't know your previous apache version?
 [2007-02-14 15:34 UTC] fuitad at gmail dot com
My apologies. Apache was 2.2.4 or 2.2.2 (depending on the server) and Lighttpd was 1.4.11.
 [2007-02-14 15:46 UTC] mike@php.net
I can't reproduce:

mike@honeybadger:~$ telnet 0 80
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
GET /abc.php HTTP/1.1
Host:honeybadger
Connection: close

HTTP/1.1 200 OK
Date: Wed, 14 Feb 2007 15:43:49 GMT
Server: Apache/2.0.55 (Ubuntu) DAV/2 MDT/1.5 PHP/5.2.2-dev
X-Powered-By: PHP/5.2.2-dev
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html

1
a
1
b
1
c
1


0

Connection closed by foreign host.
mike@honeybadger:~$ telnet 0 80
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
GET /abc.php HTTP/1.0
Host: honeybadger

HTTP/1.1 200 OK
Date: Wed, 14 Feb 2007 15:44:25 GMT
Server: Apache/2.0.55 (Ubuntu) DAV/2 MDT/1.5 PHP/5.2.2-dev
X-Powered-By: PHP/5.2.2-dev
Connection: close
Content-Type: text/html

abc
Connection closed by foreign host.
mike@honeybadger:~$ cat /www/html/abc.php
<?php
ob_implicit_flush(1);
while( @ob_end_clean() );
echo "a";
echo "b";
echo "c";
echo "\n";

 [2007-02-14 15:52 UTC] fuitad at gmail dot com
[fmg@ib-apache1 ~]$ telnet zestuff.com 80
Trying 209.172.63.175...
Connected to zestuff.com.
Escape character is '^]'.
GET /index.php HTTP/1.1
Host:zestuff.com
Connection: close

HTTP/1.1 200 OK
Date: Wed, 14 Feb 2007 15:58:13 GMT
Server: Apache
X-Powered-By: PHP/5.2.1
Pragma: no-cache
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Wed, 14 Feb 2007 15:58:21 GMT
Cache-Control: no-store, must-revalidate
Cache-Control: post-check=-1, pre-check=-1
Set-Cookie: sid=80c40a7ecf800d1a6b8044f8e2d6351174689194; expires=Thu, 14-Feb-2008 15:58:21 GMT; path=/; domain=.zestuff.com
Set-Cookie: sip=565277585; expires=Thu, 14-Feb-2008 15:58:21 GMT; path=/; domain=.zestuff.com
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html

2029
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
 [2007-02-14 15:54 UTC] fuitad at gmail dot com
[fmg@ib-apache1 ~]$ telnet fuitad.com 80
Trying 209.172.63.166...
Connected to fuitad.com.
Escape character is '^]'.
GET / HTTP/1.1
Host:fuitad.com
Connection: close

HTTP/1.1 200 OK
Date: Wed, 14 Feb 2007 16:01:11 GMT
Server: Apache/2.2.4 (FreeBSD) mod_ssl/2.2.4 OpenSSL/0.9.7e-p1 PHP/5.2.1 with Suhosin-Patch
X-Powered-By: PHP/5.2.1
X-Pingback: http://www.fuitad.com/xmlrpc.php
Status: 200 OK
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

43a2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


In both cases, I did not leave the rest of the HTML as it was irrelevant.
 [2007-02-14 15:58 UTC] fuitad at gmail dot com
I just realized something interesting...

Those telnet calls I did, none of them comes from a proxy. They are direct, yet the weird number bug appears still.
 [2007-02-14 16:10 UTC] fuitad at gmail dot com
Here is a way I found to reproduce the bug

http://www.fuitad.com/test.phps

<? phpinfo(); ?> also worked.

It seems that this bug only occurs when the response is over a certain size. Hence why your tests did not work.
 [2007-02-14 16:10 UTC] mike@php.net
This is not a "number bug". It's called chunked transfer encoding.

Try one with HTTP/1.0, and you'll see.


 [2007-02-14 16:27 UTC] fuitad at gmail dot com
Compare these two files

http://www.fuitad.com/test.php

http://www.fuitad.com/test.html

The static one does not have any problem while the php one does the chunk problem.
 [2007-02-14 16:34 UTC] fuitad at gmail dot com
.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 23:01:29 2024 UTC