drtoaamk20278 2011-12-06 10:34
浏览 552

PHP:ZipArchive :: extractTo()没有完成解压缩

I'm using ZipArchive to unzip files. It's working great, except for ONE file so far (it's 10.6MB, if that matters).

The problem is, ZipArchive::extractTo() returns FALSE, and that's correct since if fails.

BUT it doesn't completely fails: half of the file is being unzipped, and then it returns FALSE.

As this method doesn't throw any Exception, FALSE is not really great to understand what happened in the middle of that unzipping journey. If anyone already ran into that problem, i'd love some help :) Thanks!

  • 写回答

1条回答 默认 最新

  • dongsiju1941 2012-09-22 05:25
    关注

    My problem is different, but I think you're running into a memory issue.

    Try to force this:

    ini_set('memory_limit', '128M');
    set_time_limit(0);

    Also, try to get memory usage before and after script, and deal with the total:

    $mem_before = memory_get_usage();
    /* your script code here */
    $mem_after = memory_get_usage();
    printf('Memory used: %1$s bytes', ($mem_after - $mem_before));

    Maybe this points you in the right direction. ;)

    Best!
    R

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!