|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59118 Can not open more than 65535 entries
Submitted: 2010-03-15 14:09 UTC Modified: 2017-10-26 13:13 UTC
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: niculaantoniu at yahoo dot com Assigned: cmb (profile)
Status: Closed Package: Zip Related
PHP Version: 5.2.0 OS: windows XP
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: niculaantoniu at yahoo dot com
New email:
PHP Version: OS:


 [2010-03-15 14:09 UTC] niculaantoniu at yahoo dot com
I have an archive with more than 65535 entries.
The ZipArchive and the zip functions can process only 65535 

Reproduce code:
	$zip = new ZipArchive();
	$zip->open($cwd."/", ZIPARCHIVE::CHECKCONS);

	for ($idx = 0 ; $idx<70000; $idx++){
		echo "<br>".$idx." ";
		//echo $zip->getFromIndex($idx);

Expected result:
70000 entries statistics

Actual result:
i will show echo 70000 lines but the last 
with stat info is the 65534 line


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-19 15:04 UTC] niculaantoniu at yahoo dot com

 [2015-04-16 12:48 UTC]
-Package: zip +Package: Zip Related
 [2015-05-05 23:46 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2015-05-05 23:46 UTC]
I can neither reproduce this issue with PHP 5.5.24 nor 5.6.8 (nor
even 5.4.19) with the following augmented script:

    $zip = new ZipArchive();
        '', ZipArchive::CREATE | ZipArchive::OVERWRITE
    for ($i = 0; $i < 70000; $i++) {
        $zip->addFromString("$i.txt", 'foo');
    $zip = new ZipArchive();
    $zip->open('', ZIPARCHIVE::CHECKCONS);
    for ($i = 0 ; $i < 70000; $i++){
        echo $i . " ";

Do you still experience this issue with current PHP versions? If
so, we'd need further details, ideally a copy of an archive that
shows the behavior.
 [2015-05-17 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2017-10-26 12:47 UTC] marco dot clemencic at gmail dot com
For reference, I stumbled on this bug using PHP 5.3.3 (on a system equivalent to RedHat 6).

I found out that the problem was solved by the upgrade of libzip to 0.10, see

 [2017-10-26 13:13 UTC]
-Status: No Feedback +Status: Closed
 [2017-10-26 13:13 UTC]
Thanks for the info, Marco!

Since PHP 7.0.25 already requires at least libzip 0.11[1], this
ticket can be closed.

[1] <>
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC