How To Unzip/Extract Large Zip Files Using PHP Without the PECL Zip Library
If you’re on Dreamhost and you don’t want to mess with installing a clean install of PHP and then installing PECL’s Zip library, this may help…
I was able to handle several large (i.e., hundreds of megabytes) files using the pclzip library discussed here: http://stackoverflow.com/questions/1923100/unpack-extract-zip-file-with-php-without-relying-on-any-extension
Note: you have to set the location for the script to create a temporary file. Look for the line where “PCLZIP_TEMPORARY_DIR” is defined and include a file system location that is writable by the script.
Here’s the web address for the script: http://www.phpconcept.net/pclzip/
It was as easy as:
require_once('pclzip.lib.php');
$archive = new PclZip('filename.zip');
if ($archive->extract() == 0) {
echo "\n error while extract";
}