Reputation: 3523
I am currently storing lots of photos in a zip archive on a LAMP server. When a new user gets added to my program I open the zip archive and add their photo.
The problem is when the zip archive approaches 50MB the function ZipArchive::open always returns the error number 5, which I believe is this error ZIPARCHIVE::ER_READ
Does any one have a clue why this would happen?
Many thanks,
Theo.
Upvotes: 1
Views: 767
Reputation: 3523
In the end I stopped using the ZipArchive class and zipped the files up on the command line using the php exec command http://php.net/manual/en/function.exec.php
exec('tar -cvf file.tar myfile.txt');
Upvotes: 1
Reputation: 4784
Try increasing php's memory_limit
. It's possible it's running out of memory when loading a larger .zip file.
Upvotes: 0