My host does not allow me to use the shell_exec() function, which is understandable enough! So I have been trying to figure out a way of unzipping large files in PHP.
I have tried using unzip.lib.php http://www.koders.com/php/fidC24DE94469E1C2E7FEA00F3AD26688559729E7A4.aspx?s=excel
but it has a limit of 8 meg to the zip size. I added this to replace lines 246 and 247:
- Code: Select all
$bytes_to_read=$this->Size;
$byte_size_packages=$bytes_to_read/8000;
$bytes_read=0;
$oF=fopen($in_FileName,'rb');
$vZ=0;
while($bytes_read<$bytes_to_read){
$vZ_part=@fread($oF,$byte_size_packages);
if(strlen($vZ_part)==0)
break;
$vZ.=$vZ_part;
$bytes_read+=$byte_size_packages;
}
I had to do that because the old fread() function was exhausting it's 8meg limit. But still I get this error:
- Code: Select all
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 133188854 bytes) in unzip.lib.php on line 258
Is there anyway of actually unzipping say a 60meg file in PHP without having a memory problem?