0

PHP 5.3+'s native ZipArchive class (http://php.net/ziparchive) creates corrupt result files (.zip), but only when the result .zip is larger than ~4GB (i think 3,6 GB. Server is Ubuntu 10.10 64bit, 4GB RAM, latest PHP 5.3). The error (when unzipping this .zip, with whatever software you use) is:

file #1:  bad zipfile offset (lseek): 

According to several posting on the web this is simply the (undocumented) max limit for this class / the zip function. My question is: How to fix this, quick and dirty ? Are there some possible php.ini or server settings ? Or some other ways to create 4GB+ .zip files on native ubuntu systems ? I don't have root access and cannot install new packages.

There are some similar Q&As on this on Java: Zip files with Java: Is there a limit?

Community
  • 1
  • 1
Sliq
  • 15,937
  • 27
  • 110
  • 143

2 Answers2

2

Wikipedia's quote :

The original zip format had a 4 GiB limit on various things (uncompressed size of a file, compressed size of a file and total size of the archive), as well as a limit of 65535 entries in a zip archive.

This is not a limitation of the class, but zip itself. You could switch to tar.gz for instance.

Ugo Méda
  • 1,205
  • 8
  • 23
0

I believe this is an issue with the file system used by the operating system. I would look at storing the data in multiple archive files.

JasonDZA
  • 51
  • 3
  • I know one should not make assumptions, but the default file system of ubuntu (over the various ubuntu versions) is one of the extX-family and even ext2 suppot 2TiB-files ;) – KingCrunch Jul 12 '12 at 09:21