dongzhuanlei0768 2012-07-12 09:14
浏览 86
已采纳

当.zip> = 4GB时,PHP的本机ZipArchive类失败。 怎么修?

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?

  • 写回答

2条回答 默认 最新

  • doupike2351 2012-07-12 09:21
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 求给定范围的全体素数p的(p-2)的连乘积
  • ¥15 VFP如何使用阿里TTS实现文字转语音?
  • ¥100 需要跳转番茄畅听app的adb命令
  • ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术
  • ¥15 请问有用MZmine处理 “Waters SYNAPT G2-Si QTOF质谱仪在MSE模式下采集的非靶向数据” 的分析教程吗
  • ¥50 opencv4nodejs 如何安装
  • ¥15 adb push异常 adb: error: 1409-byte write failed: Invalid argument
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页