Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    New Coder
    Join Date
    Apr 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question installing zziplib

    Do anybody know how to install zziplib library from
    http://zziplib.sourceforge.net/

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,077
    Thanks
    11
    Thanked 98 Times in 96 Posts
    <mystic_firepages_prediction>
    someone will ask 'what platform' ?
    you will reply 'what does difference does the platform make'
    </mystic_firepages_prediction>
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    New Coder
    Join Date
    Apr 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I will not say that, it is "windows 2000 professional"

  • #4
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,077
    Thanks
    11
    Thanked 98 Times in 96 Posts
    Quote Originally Posted by romram
    I will not say that, it is "windows 2000 professional"
    excellent choice

    grab http://prdownloads.sourceforge.net/z...n.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/bin directory [set in my PATH] and keep all the unix type & command line executables in there.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #5
    New Coder
    Join Date
    Apr 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...
    Last edited by romram; 04-19-2004 at 09:21 AM.

  • #6
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,077
    Thanks
    11
    Thanked 98 Times in 96 Posts
    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() or system() calls.

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

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #7
    New Coder
    Join Date
    Apr 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    so if I have the following code:

    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_path=$path.str_replace('/','\\',dirname(zip_entry_name($zip_entry)));
    $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";
    fclose($fd);
    zip_entry_close($zip_entry);
    }
    }
    }
    zip_close($zip);
    }
    } ?>
    <?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??
    Last edited by romram; 04-19-2004 at 09:34 AM.

  • #8
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,077
    Thanks
    11
    Thanked 98 Times in 96 Posts
    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)

    extension=php_zip.dll

    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.

    <edit>
    php_zip.dll for PHP4 (may not work on 4.3.5/6)
    </edit>
    Last edited by firepages; 04-19-2004 at 10:12 AM.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #9
    New Coder
    Join Date
    Apr 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I did what you said ,but I'm still getting the same error??

  • #10
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,077
    Thanks
    11
    Thanked 98 Times in 96 Posts
    did you restart the server ? to check if the extension is loaded make a page with just

    <?phpinfo();?>

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

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #11
    New Coder
    Join Date
    Apr 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is this what you want me to check:

    PHP Version 4.3.3

    ZLib Support enabled

  • #12
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,077
    Thanks
    11
    Thanked 98 Times in 96 Posts
    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
    extension=php_zip.dll

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

    restart apache & check phpinfo() again.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #13
    New Coder
    Join Date
    Apr 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 :
    extension=php_zip.dll
    it wasn't there, but I add it...

  • #14
    New Coder
    Join Date
    Apr 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Please reply to me, firepages... I am realy need an answer...

  • #15
    New Coder
    Join Date
    Apr 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •