PHPでzipファイルをレンダリングしようとしています。コード:
header('Content-Type: application/zip');
header('Content-Length: ' . filesize($file));
header('Content-Disposition: attachment; filename="file.zip"');
ダウンロードしたファイルは、わずか数バイトです。これはエラー メッセージです。
<br />
<b>Fatal error</b>: Allowed memory size of 16777216 bytes exhausted (tried to allocate 41908867 bytes) in <b>/var/www/common_index/main.php</b> on line <b>217</b><br />
php.ini で memory_limit を増やしたくありません。グローバル設定をいじらずに大きな zip ファイルを適切にレンダリングする別の方法は何ですか?