Search code examples
phpunzip

Is there any on server unzip lib for PHP?


We are using dUnzip2 in our script to unzip files before download, write license then use zip.lib to zip it and serve. But the dUnzip2 is using:

foreach ($f as $file_row => $file) 

which works fine for small files , but for files larger than 10 mb it should use something like

for($n = 1;$n < count($f);$n++){
    $file = $f[$n];
}

which is causing memory limit issues on files that are bigger than 10MB. We have to increase memory limit on the server for that lib all the time. The script itself is HUGE and to be honest I would not dare on taking the task to modify it.

So do you know any other unzip library that would do the same job as dUnzip2 or better solution?


Solution

  • Why not use PHP's built in Zip stuff: http://www.php.net/manual/en/zip.examples.php

    Obviously assuming it's enabled (usually is) do a phpinfo() to check.