By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,536 Members | 1,504 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,536 IT Pros & Developers. It's quick & easy.

PHP 4+ - 5.0.4, Windows XP and Gzip - HELP

P: n/a
I am simply trying to zip together selected files into a single ZIP
file. Windows XP doesn't have a native process by which you can do
this, so I borrowed gzip, downloaded and installed, and upon using it:

$msg = exec('gzip -q --suffix .zip '. @join(' ', $fileArray));

All of my files named in $fileArray were horribly mangled!! They all
were converted individually into files with .zip extension that lost
all of their original data structures.

I was told it was "so easy" to use gzip.. so how do I use gzip? No
tutorial exists that I can find that even explains gzip; the docs are
absolutely not helpful and man gzip is not going to happen since I'm in
Windows and not UNIX ("gzip -h" does not help either, I need a clear
example of how to compress files together into a single .zip file, like
what WinZip does).



Oct 13 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
Resolved by not using gzip.. using PEAR-based class Archive_Zip


Oct 13 '05 #2

P: n/a
comp.lang.php wrote:
I was told it was "so easy" to use gzip.. so how do I use gzip?


Glad that you're sorted out already. Anyway, if I'm right you were
actually trying to use command line version of gzip.

If you have zlib enabled (it must be enabled as you could use
Archive_zip), you can use gzip functions <>. As
the usernotes suggest, possibly the easiest way to create gzipped file
is using URL wrapper:

file_put_contents('compress.zlib://hello.txt.gz', 'Hello');

<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog:

Oct 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.