我在CodeIgniter中工作。我所試圖做的就是下載由ZIP類笨創建的zip文件,我得到這個錯誤:CodeIgniter Zip Class:允許的內存耗盡
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 30381518 bytes) in ..\system\core\Output.php on line 366
我的PHP代碼:
foreach ($attachments as $attachment) {
if ($attachment->type === 'file') {
$data = @file_get_contents($uploadDirectory . $attachment->fullPath . DIRECTORY_SEPARATOR . $attachment->physicalName);
$attachment->location = ltrim($attachment->location, '/');
$fileName = $attachment->location ? $attachment->location . DIRECTORY_SEPARATOR . $attachment->name : $attachment->name;
$this->zip->add_data($fileName, $data);
}
}
請誰能幫我解決此錯誤,並感謝您的任何幫助!
這不是錯誤,這是代碼!你得到的錯誤是什麼? – sunny
在php.ini中增加允許的PHP內存? –
感謝您的回覆。 –