Theo Kouzelis
Theo Kouzelis

Reputation: 3523

PHP ZipArchive::open always results in an ZIPARCHIVE::ER_READ error

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

Answers (3)

Theo Kouzelis
Theo Kouzelis

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

mega.venik
mega.venik

Reputation: 658

Also try to increase max_execution_time.

Upvotes: 0

cOle2
cOle2

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

Related Questions