|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21304 gzopen does not open the file
Submitted: 2002-12-31 01:40 UTC Modified: 2002-12-31 05:43 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: Assigned: wez (profile)
Status: Closed Package: Zlib related
PHP Version: 4.3.0 OS: Linux 2.4.18
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:
New email:
PHP Version: OS:


 [2002-12-31 01:40 UTC]
This was working fine with 4.2.3.  Simple script, yes I should if $fp, but it is a test script.


    $fp=gzopen("/tmp/test.txt.gz", "a");

    gzwrite($fp, "this is a line\n");




$fp is empty but there is no error from gzopen at all.  I have all errors on.  In fact, you do get a warning from gzwrite and gzclose that $fp is not valid stream.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-31 01:43 UTC]
FWIW, I just checked and only append is affected.  If I open the file with "w", it works fine.  Obviously, I need "a", but that should help.
 [2002-12-31 05:31 UTC]
I can see 2 problems with the code; fixes going in shortly.
 [2002-12-31 05:43 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 30 16:01:33 2024 UTC