简体   繁体   中英

Create ZIP file in php , windows

I have to create a zip file using php. The files are located in a directory of my web server. I have to add these files ( dynamically ) and make a zip file.

Working perfect in php with small files but when I tried to make zip using files greater than 200 MB I will take more time to create zip.

So is there is any way to make a zip file using windows system command, which can run through PHP ? So that we can create zip files easily and quickly with out memory loss .

Please help

You could try to implement a queue of some kind, perhaps in your database. You enqueue zip operations, while on the background a cron job of some kind does the zipping, and notifies your queue when it's finished.

This won't decrease processing time, but since zipping is a CPU and I/O heavy operation, it probably can't be sped up much. Using this technique you don't have to let your user wait until zipping is done, you could for example simply send an e-mail (with the link to the created zip file) when it's done.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM