In case you still want to use the PHP ZipArchive, there are a few things you can do to prevent certain server/OS limitations:
Memory Although it might seem obvious in your case, i have seen many examples on how to use ZipArchive that use addFromString to add a new File to the archive. DON'T! This will allocate memory to open the file and store its content in it, which will make you run out of memory fast, use addFile instead. Make also sure that you free all the memory you don't need.
Execution time Increase the maximum execution time for your script, either via the php.ini, or with ini_set (e.g. ini_set('max_execution_time', 600);
to have a maximum execution time of 10min)
File Handles Some OS have limits on the number of open files which can cause a problem because PHP only adds the files to the zip once you close the zip file. To prevent problems with the number of open files just close and reopen the zip file every x files (e.g. every 1000), this will force PHP to compress and add the files already assigned to the archive.
File Size There may be some file size limitations of the OS, a bigger file also means that PHP needs more memory to manage it, so i personally prefer to use a maximum file size after which i just open a new zip file using an index number. If the exact file size does not matter to you, you can just count the size of the files going into the archive and then switch after you reach a certain limit, or you can close the archive every x files and check its size on disk to decide wether to start a new archive or not (remember, the files get only compressed once you close the archive)
I personally like to limit the filesize by getting the size of the files going into the archive and applying a likely compression factor to it to see when the maximum archive size will probably be reached (jpg files ~0.9, zip files = 1, text files ~0.10, ...) and then switch to the next volume.