scooter41 Posted July 31, 2008 Share Posted July 31, 2008 Hey There, I am using php system that creates zip's on the fly adding files before delivering the zip file to the user via http. Everything works fine when adding smaller mp3 files, but as soon as you add say 4 of 5 wav files to the zip, which are around 12 meg each, the script soon runs out of memory, as it appears to keep adding the files to ram rather than flush and write the temporary file to disk. I am using the following script to create the zip files, but this happens with others I have tried also: http://pear.php.net/package/Archive_Zip/docs/latest/Archive_Zip/Archive_Zip.html Does anyone have any suggestions? Many thanks for your help in advance Rgds Scott Link to comment https://forums.phpfreaks.com/topic/117538-creating-large-zip-files-anyway-to-prevent-running-out-of-memory/ Share on other sites More sharing options...
ikmyer Posted July 31, 2008 Share Posted July 31, 2008 there is a php.ini setting which sets the amount of memory allowed to a script... try changing this. Link to comment https://forums.phpfreaks.com/topic/117538-creating-large-zip-files-anyway-to-prevent-running-out-of-memory/#findComment-604652 Share on other sites More sharing options...
scooter41 Posted July 31, 2008 Author Share Posted July 31, 2008 right, I have set it up to 256 meg already, but the thing that concerns me, is: Firstly someone will probably be downloading 30 wav files at a time, so thats on average 300meg which is over the limit, plus this is likely to be a hard hitting site, so say 10 people are on the site at once, thats just going to nuke the ram..... Link to comment https://forums.phpfreaks.com/topic/117538-creating-large-zip-files-anyway-to-prevent-running-out-of-memory/#findComment-604659 Share on other sites More sharing options...
rhodesa Posted July 31, 2008 Share Posted July 31, 2008 you could try generating the ZIP file using command line tools. use them to make a temporary zip, and then give them that to download Link to comment https://forums.phpfreaks.com/topic/117538-creating-large-zip-files-anyway-to-prevent-running-out-of-memory/#findComment-604662 Share on other sites More sharing options...
scooter41 Posted August 1, 2008 Author Share Posted August 1, 2008 I will try having a look at that... the trouble is the user is able to choose which files to zip, rather than select all from one folder, and then they are also renamed before adding to the zip file... so the php solution was ideal. Im not sure how graceful that would be with the command line, I will take a look Link to comment https://forums.phpfreaks.com/topic/117538-creating-large-zip-files-anyway-to-prevent-running-out-of-memory/#findComment-605326 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.