views:

72

answers:

3

I need to compress some binary files as quickly as possible with PHP - it needs to be reasonably fast and easy to use. What options can you fantastic people recommend? :)

Jamie

A: 

If clients are going to be downloading these you can setup Apache to compress them as they are served.

If it is something where you are going to be storing them on the server you can PHPZip them.

Mike Buckbee
+2  A: 

I don't have any personal experience with them but there's a whole section in the docs on Compression and Archive Extensions

It looks like there are extensions for

If you're working directly with files on the server, the ZipArchive class (that comes with the Zip extension) looks like it might be the easiest to use.

Mark Biek
bz2 will usualy provide the best compression but if it is being given to users its best to use zip
Unkwntech
A: 

If the extension is available on your server or if you can add it, LZF is what you're looking for. Otherwise, gzcompress() with a compression level of 3 or less will be plenty fast.

Josh Davis