|
|
| |
1. Allowed memory size to allocate |
|
Reply |
|
|
 Michal | 2009-12-28 13:17:47 |
Hi,
On my server I need to uncompress file which is exported part of database from other server. Zipped file is 10mb, inside is only one file more than 500mb.
My code:
<code>
<?php
require_once dirname(__FILE__)."/classes/dUnzip2.inc.php";
$data = implode(file("http://www.xxx.pl/offer.php?cmd=trips_z&username=user&password=pass&format=gzip"));
if($fh = fopen('trip_brazil.zip', 'w+')){
fputs($fh, $data);
fclose($fh);
}
$zip = new dUnzip2('trip_brazil.zip');
$zip->unzipAll();
?>
</code>
The problem is memory limit to allocate.
Here is the error message:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 543881838 bytes) in /home/studiomi/public_html/eximoferta/classes/dUnzip2.inc.php on line 310 |
| |
2. Re: Allowed memory size to allocate |
|
Reply |
|
|
 Korosh Raoufi | 2011-12-12 16:26:00 - In reply to message 1 from Michal |
I found a way
if ini_set is not limited on your web server
you can use
this before run unzip class
ini_set('memory_limit','1024M'); |
|