|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #46577 gzip functions don't read/write mtime header
Submitted: 2008-11-15 11:34 UTC Modified: 2011-04-08 18:23 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: mmj048 at gmail dot com Assigned:
Status: Open Package: Zlib related
PHP Version: 5.2.6 OS: Windows Vista
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 — but make sure to vote on the bug!
Your email address:
Solve the problem:
27 + 14 = ?
Subscribe to this entry?

 [2008-11-15 11:34 UTC] mmj048 at gmail dot com
The gzencode and gzwrite functions, which implement RFC 1952 (, don't read/write the mtime header.
While this is not necessary for gzip compliance ( adding a function to read/write the mtime header when compressing or reading compressed files would be very useful in many cases.

I currently use custom code to read/write the gzip mtime header.


$gzmtime = end(unpack('V', file_get_contents($gzfile, null, null, 4, 4)));


$r = fopen($gzfile, 'r+');
fseek($r, 4);
fwrite($r, pack('V', $filemtime), 4);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-08 18:23 UTC]
-Package: Feature/Change Request +Package: Zlib related
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Nov 27 18:01:25 2020 UTC