Thanx.. however, I was so fed up that I did away with gzip altogether and found a PEAR-based utility that works just as well, allowing me to produce a cross-platform zipping class object method:
function &zip($zipName, $fileList) { // STATIC VOID METHOD
/*-------------------------------------------------------------------------------------------
New 10/13/2005: Windows has no stable process as of this date to do command-line
file archiving ("zip"), thus, a cross-OS methodology to involve Windows command-line
usage will become, at the very least, problematic, after extensive testing. However,
there is an available library included with this application that will perform the
same file archiving capability as the UNIX "zip" command within ./include/zip.inc.php
For more information go to
http://cvs.php.net/pear/Archive_Zip/Zip.php?php=3869971673a722307df9b9613f634232
UPDATE: Will use this functionality only if you are running Windows and Apache together,
otherwise, you are free to use a command-line based OS utility provided within the
inherited getKommandOSArray() method as such are unstable within Windows and Apache
formats (based upon PHPBuilder, Google, and my PHP-DC Users Group)
-------------------------------------------------------------------------------------------*/
global $section, ${$section . 'LocationPath'};
$locationPath = ($_REQUEST['album']) ? "${$section . 'LocationPath'}/" . $_REQUEST['album'] : ${$section . 'LocationPath'};
if ($_ENV['windir'] && stristr(strtolower($_SERVER['SERVER_SOFTWARE']), 'apache') !== false) { // WILL EXCLUSIVELY BE USED BY WINDOWS/APACHE
$zip =& new Archive_Zip("$locationPath/$zipName"); // SEE NOTES IN ./include/zip.inc.php on CONSTRUCTOR BUILDING
// SEE NOTES IN ./include/zip.inc.php ON USAGE OF create() METHOD
$fileListArray = preg_split('/"[\s\t]+"/', $fileList);
@array_walk($fileListArray, create_function('&$a', '$a = str_replace(\'"\', \'\', $a);'));
if (@!$zip->create($fileListArray, array('remove_all_path' => true))) {
$this->isSuccessful = false;
$this->setErrorArray(array('action' => "Error attempting to create $section downloadable zip file from album \"$album\": " . nl2br(htmlentities($zip->errorInfo()))));
}
} else { // DEFAULT ZIPPING UTILITY BY ALL OTHER OS'S OR WINDOWS AND !APACHE
// NEW 4/1/2005 SEE NOTES IN classes.inc.php ON getKommandOSArray() METHOD
list($zipKommand, $zipRedirect) = @array_values($this->getKommandOSArray('zip-jF9'));
$msg = exec("$zipKommand $locationPath/$zipName " . trim($fileList) . " $zipRedirect");
if (preg_match('/zip error:/i', $msg)) {
$this->isSuccessful = false;
$this->setErrorArray(array('action' => "Error attempting to create $section downloadable zip file from album \"$album\": " . nl2br($msg)));
}
}
}
I could not use any "zip" function, pkzip, zip or any other zip, within my Windows XP box, and WZZIP, the command-line utility add-on to WinZip, cannot work in Apache (Apache will lock up and crash your box if you try!), so I tried the only thing left to me and that was the Archive_Zip class created by the people at www.php.net which I implemented into my application and it works beautifully in Windows XP and Apache, and for Windows/Non-Apache I failsafe to the WZZIP utility which is documented to be required for Windows and non-Apache, and for *Nix, just plain 'ol "zip".
Thanx!
Phil