View Single Post
Old 07-23-2010, 02:59 AM   #2 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Gzip compresses (and can only compress) a single file. To create a package of files maintaining structure, you need to first create a tarball, then compress that. This is why you see the file extensions .tar.gz and .tgz for archived packages (gzipped tarball). The only things that are compressed directly by gzip are usually long text files, such as log files, etc.

Depending on what you are attempting to do, you may be better off writing a bash script to create your compressed archive. PHP has the exec() function to run command line operations, but using such methods is only recommended if you are well versed in the security concerns it raises.
delayedinsanity is offline  
Reply With Quote