|  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: 2023-01-04 21:22 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: mmj048 at gmail dot com Assigned:
Status: Duplicate Package: Zlib related
PHP Version: 5.2.6 OS: Windows Vista
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.
Block user comment
Status: Assign to:
Bug Type:
From: mmj048 at gmail dot com
New email:
PHP Version: OS:


 [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
 [2023-01-04 20:26 UTC] cmanley at xs4all dot nl
I've added a feature request related to this here in order to set/read it via stream context options:
 [2023-01-04 21:22 UTC]
-Status: Open +Status: Duplicate
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 03:01:29 2024 UTC