View Full Version : installing zziplib

04-19-2004, 07:45 AM
Do anybody know how to install zziplib library from

04-19-2004, 07:52 AM
someone will ask 'what platform' ?
you will reply 'what does difference does the platform make'

04-19-2004, 07:57 AM
I will not say that, it is "windows 2000 professional"

04-19-2004, 09:25 AM
I will not say that, it is "windows 2000 professional"

excellent choice ;)

grab http://prdownloads.sourceforge.net/zziplib/zziplib-0.10.82-msvc6-bin.zip?download

2 choices ,
1) install in your path

e.g. extract the *.exe 's from the zipfile to your c:/windows(winnt) directory & the zzip-1.dll to c:/windows(winnt)/system32

you can then access the lbrary from the command prompt (try typing 'zzdir --help' at a dos prompt (may be '?' or '/?' or '-h' instead of '--help')
or exec via PHP <?exec("zzdir $args");?>

2) extract elsewhere , say c: (files will extract to c:/bin/$files) , you will now need to cd to the directory in DOS or be explicit in your exec()
<?exec("c:/bin/zzdir.exe -$args");?>

3) (I know I said 2) add 'c:/bin' to your PATH .. I use c:/cygwin (http://www.cygwin.com)/bin directory [set in my PATH] and keep all the unix type & command line executables in there.

04-19-2004, 09:59 AM
Please if you dont mind can I ask you what is the benefit of this line?
<?exec("zzdir $args");?>
Where to put it, is it in .php , and where to save this file..
because I am new in php and I dont know about installing liberaries in php...

04-19-2004, 10:16 AM
zziplib is not a PHP library, it is (on win32) a command line executable, built-in/extended PHP libraries give you built in functions (e.g. mysql_query() etc)

External libraries require another way to access the libraries , e.g. via exec() (http://www.php.net/exec) or system() (http://www.php.net/system) calls.

You can also write your own PHP extensions to access 3rd party libraries if you have the time and patience.

04-19-2004, 10:25 AM
so if I have the following code:

<? function unzip($file, $path) {
$zip = zip_open($file);
echo "unzipping".$file."to ".$path ;
if ($zip) {
while ($zip_entry = zip_read($zip)) {
if (zip_entry_filesize($zip_entry) > 0) {
// str_replace must be used under windows to convert "/" into "\"
$complete_name=$path.str_replace ('/','\\',zip_entry_name($zip_entry));
if(!file_exists($complete_path)) {
$tmp = '';
foreach(explode('\\',$complete_path) AS $k) {
$tmp .= $k.'\\';
if(!file_exists($tmp)) {
mkdir($tmp, 0777);
if (zip_entry_open($zip, $zip_entry, "r")) {
$fd = fopen($complete_name, 'w');
echo $zip_entry;

fwrite($fd, zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)));
echo zip_entry_filesize($zip_entry)."written";
} ?>
<?php unzip("todo02.zip", "C:\\") ?>

where to put the line of code you told me about?
because I get an error massege like this:
"Fatal error: Call to undefined function: zip_open() in C:\sokkit\site\unzip.php on line 2"

Note: I didn't find system32 in folder windows just system, are they the same??

04-19-2004, 11:08 AM
lol ok , my own fault (especially after asking what platform ;))
ignore the stuff above (including installing the libraries you don't need them , you only need them on *NIX)

you just need to enable the zip extension

you need to open up your php.ini (should be in c:/windows(winnt)/php.ini and add (or uncomment if exists)


make sure that php_zip.dll already exists in your extension directory , if you dont have php_zip.dll then let me know your php version & I may have one that works (do not currently have one for php5).

restart the server
run your code as is.

php_zip.dll for PHP4 (may not work on 4.3.5/6) (http://www.firepages.org/public/php_zip.dll)

04-20-2004, 03:09 PM
I did what you said ,but I'm still getting the same error??

04-20-2004, 03:44 PM
did you restart the server ? to check if the extension is loaded make a page with just


in it , look in the extensions to see if it is enabled or not , also get your version number from there

04-21-2004, 07:12 AM
Is this what you want me to check:

PHP Version 4.3.3

ZLib Support enabled

04-21-2004, 07:44 AM
Hi yes, however we are looking for 'Zip' extension [not zlib which should be installed by default]...

in the first block of phpinfo output look for the value of ..

Configuration File (php.ini) Path :: (should be something like)c:/windows/php.ini

check that in that file you have the uncommented line

and that the 'extension_dir' setting points to the folder that contains your php_zip.dll

restart apache & check phpinfo() again.

04-21-2004, 08:01 AM
I checked the things you told me about and every thing is as you said it how it should be..
but I would like to tell you that the first time you told me about :
it wasn't there, but I add it... :(

04-21-2004, 10:25 AM
Please reply to me, firepages... I am realy need an answer... :(

04-23-2004, 08:07 PM
Maybe it is the extension must be be:
"extension=php_zlip.dll" not "extension=php_zip.dll",
and from where can I get the "php_zlip.dll" do put it in the extensions folder? :confused:

04-23-2004, 08:48 PM
hi , no extension=php_zip.dll is the correct one , zlib , whilst compression related is a totally different thing to zip.

not really sure what to say , if the extension could not be loaded for any reason you should get an error generated by your server when you restart it 'could not load module'... etc , else it just should work? , check your server & PHP error logs , perhaps they can shed some light on the issue ??