doujiufutaog59220 2018-05-23 17:44
浏览 58

使用PHP提取大档案.zip(> 2 GB)

The following zip program works without any issues for smaller size files approximately few hundred MB. But when the .zip archives are bigger, the program showing zip archive extraction failed. I have increased mem size and exec time. My file zip size is 2.30GB. My code is:

ini_set('max_execution_time', 0);
ini_set('memory_limit', '30000M');

function unzip_file($file, $destination)
{
    // create object
    $zip = new ZipArchive() ;
    // open archive
    if ($zip->open($file) !== true) {
        return false;
    }
    // extract contents to destination directory
    $zip->extractTo($destination);
    // close archive
    $zip->close();
        return true;
}

if (unzip_file($_SERVER["DOCUMENT_ROOT"].'/testarul/www.zip', $_SERVER["DOCUMENT_ROOT"].'/testarul/')) {
    echo 'zip archive extracted successfully';
} else {
    echo 'zip archive extraction failed';
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度