From: mortoray at ecircle-ag dot com
Operating system: Windows NT 5.0 build 219
PHP version: 4.3.4
PHP Bug Type: Zlib Related
Bug description: system function produces garbage with zlib.output_copmression
Description:
------------
Using the zlib.output_compression=On and the function system() produces
garbage output to the browser. Specifically, it does a gzip encoding but
omits the "Content-Encoding: gzip" header.
Using "passthru" instead of "system" works as intended.
Turning off compression and using "system" works as intended.
Reproduce code:
---------------
<?php
//in php.ini set zlib.output_compression=On
//replace system with passthru to make it work
system( "cmd.exe /c dir" );
?>
Expected result:
----------------
Either system() should somehow turn off the zlib compression or its output
should be compressed properly and the proper headers should be set.
--TCP Flow with passthru()--
GET /dir.php HTTP/1.0
Host: qatest.ecircle.de:8080
Accept: text/*, image/jpeg, image/png, image/*, */*
Accept-Charset: iso-8859-1, utf-8;q=0.5, *;q=0.5
Accept-Encoding: x-gzip, x-deflate, gzip, deflate, identity
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; Linux; en_US, en)
HTTP/1.1 200 OK
Date: Thu, 04 Mar 2004 09:12:41 GMT
Server: Apache/2.0.45 (Win32) PHP/4.3.4
X-Powered-By: PHP/4.3.4
Content-Encoding: gzip
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=ISO-8859-1
...........S=O.0..+.?...X.J.-..dAbb`...kk5q...e..sm.
m"q.....{.C.....5....c...1,!..b
....}.MYb.p{..Ks.....x...._x.....2....5..!......5..I.5..._..........?.."a\.B........|......j....i...Iw..*....i.........[yE..
.-.~N.W.'.Xmy....).........7V.n.,sE.....ye....r.I||...c..4...?f...Y.....gW....h!..h.....);?.v...O.:H.A1...U6.^..6......z.......d..g...5..nz.M.XWaM..o%.......>..7
..5.c....y....6.K.aB......f..p.
......`...
...
Actual result:
--------------
--TCP Flow with system()--
GET /dir.php HTTP/1.0
Host: qatest.ecircle.de:8080
Accept: text/*, image/jpeg, image/png, image/*, */*
Accept-Charset: iso-8859-1, utf-8;q=0.5, *;q=0.5
Accept-Encoding: x-gzip, x-deflate, gzip, deflate, identity
Accept-Language: en
Cache-control: no-cache
Pragma: no-cache
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; Linux; en_US, en)
HTTP/1.1 200 OK
Date: Thu, 04 Mar 2004 09:13:45 GMT
Server: Apache/2.0.45 (Win32) PHP/4.3.4
X-Powered-By: PHP/4.3.4
Connection: close
Content-Type: text/html; charset=ISO-8859-1
...........S.n.0..#..{..X.....J.\*..CO\...E..........B"un.ggggc...Ma..hA.x.........+.r.nUO..2.!..U..F...".'.o...h.....$...:.9.L..u`q...$.
@.Pxp.s....W..3.*|...*B...t.)H..,S.....vK..*.J..A.gYn..T.$L.=...8..Q.....I{......7X.]A..)M,..g3<.=^_0.uZZ..^.........#..M..L.wPL....).N.V.!;..A....l!o.(Q....)k3.O.....u.5..
..i.O....M.$N.q.....K4 >[EMAIL PROTECTED]|....{...P.0.......>......6...
%.78....n.~..........C
...
--
Edit bug report at http://bugs.php.net/?id=27490&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27490&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27490&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27490&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27490&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27490&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27490&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27490&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27490&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27490&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27490&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27490&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27490&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27490&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27490&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27490&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27490&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27490&r=float