php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40873 ZipArchive doesn't open zip files containing high number of files
Submitted: 2007-03-20 20:05 UTC Modified: 2007-03-20 20:10 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: php-bugs at spuetz dot ath dot cx Assigned: pajoye (profile)
Status: Not a bug Package: Zip Related
PHP Version: 5.2.1 OS: Linux 64bit
Private report: No CVE-ID: None
 [2007-03-20 20:05 UTC] php-bugs at spuetz dot ath dot cx
Description:
------------
If a zip file contains more than 8xx files, ZipArchive::open returns ZIPARCHIVE::ER_READ. It's working under 32bit, but failling under 64bit systems (I tried two amd 64 systems).

5.2.1 and php5.2-200703201930 doesn't work.

Is this really a php issue?

Reproduce code:
---------------
#!/bin/sh
rm -rf test1 test2 test1.zip test2.zip
mkdir test1 test2
cd test1
php -r 'for ($i = 1; $i < 800; $i++) system("touch test$i.txt");'
cd ../
zip -r test1.zip test1 > /dev/null
php -r '$zip = new ZipArchive(); var_dump($zip->open("test1.zip")); var_dump($zip->numFiles);'

cd test2
php -r 'for ($i = 1; $i < 876; $i++) system("touch test$i.txt");'
cd ../
zip -r test2.zip test2 > /dev/null
php -r '$zip = new ZipArchive(); var_dump($zip->open("test2.zip")); var_dump($zip->numFiles);'


Expected result:
----------------
[mas@sw-nbk01 zip]$ sh ./zip.sh 
bool(true)
int(800)
bool(true)
int(876)



Actual result:
--------------
[mas@www zip]$ sh ./zip.sh 
bool(true)
int(800)
int(5)
int(0)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-20 20:10 UTC] pajoye@php.net
You reach the file limit of your OS.

See:http://pecl.php.net/bugs/bug.php?id=8714

You can increase it (see the manual of your OS to know how to increase it). By the way, having less than 1000 for a linux web server is not really a good idea.

It is a duplicated bug (> bogus) as we already have one as feature to use the php stream api internally (with IO ctx).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 19:01:30 2024 UTC