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 nginx中的CORS策略应该如何配置
  • ¥30 信号与系统实验:采样定理分析
  • ¥100 我想找人帮我写Python 的股票分析代码,有意请加mathtao
  • ¥20 Vite 打包的 Vue3 组件库,图标无法显示
  • ¥15 php 同步电商平台多个店铺增量订单和订单状态
  • ¥15 关于logstash转发日志时发生的部分内容丢失问题
  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题