If you need to download the files immediately without changing server settings, use these strategies:
1. Download in Batches (Chunking)
Instead of selecting the entire folder (e.g., public_html), select sub-folders or groups of files individually.
2. Exclude Large Media Files Often, the size limit is breached because of a few massive video files or high-resolution images. total size of requested files is too large for ziponthefly
3. Use an FTP/SFTP Client This is the most robust solution. Web-based file managers have limits; FTP clients (like FileZilla, WinSCP, or Cyberduck) generally do not.
You’re most likely to see this message in: If you need to download the files immediately
If you’re on shared hosting, open a support ticket. Ask them to:
Some hosts (e.g., GoDaddy, Bluehost) may refuse; they often cap ZipOnTheFly at 100-250MB by design. but memory usage drops dramatically.
If your users regularly need to download large sets of files (e.g., galleries, backup archives, datasets), ZipOnTheFly is the wrong approach. Instead, consider these robust alternatives.
Stream the ZIP in smaller pieces using HTTP range requests. This is complex but possible. Libraries like ZipStream-PHP can send ZIP parts without loading everything into memory.
// ZipStream example (memory-efficient)
$zip = new ZipStream\ZipStream('download.zip');
foreach ($files as $file)
$zip->addFileFromPath($file['name'], $file['path']);
$zip->finish();
Even then, the total size is still bounded by execution time, but memory usage drops dramatically.