I am trying to unzip a huge file (400 + M compressed over 4G unzipped) using the zpp zip archive. I only unzip one csv file in a zip file. The file that I am interested in is unpacked, exceeds 4G .. I get up to 3 entries from the end of the file, and the process takes off to the ground. I mean, the process just continues .. there is no output .. there are no errors, its cycle just continues ... I don’t know what it does .. my code is simple:
$zip = new ZipArchive;
$res = $zip->open($file);
if ($res === TRUE)
{
$num = $zip->numFiles;
for($i = 0; $i < $zip->numFiles; $i++)
{
$filename = $zip->getNameIndex($i);
$content = '';
$unzipped = fopen($dir ."/2" . $filename , 'wb');
$fp = $zip->getStream($filename);
if(!$fp) exit("failed\n");
while (!feof($fp))
{
$chunkSize = 10240;
$contents = fread($fp, $chunkSize);
$fwrite = fwrite($unzipped, $contents);
}
fclose($fp);
fclose($unzipped);
}
$zip->close();
fclose($filename);
}
, , . . ( , 3 )... , , -.. , , .. .. ( is_source ($ fp) fread.. .. .. apache.. , ...