|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39388 provide --with-libzip-dir configure option to allow usage of system's libzip
Submitted: 2006-11-05 03:50 UTC Modified: 2011-07-20 17:40 UTC
From: crrodriguez at opensuse dot org Assigned: pajoye (profile)
Status: Not a bug Package: Zip Related
PHP Version: 5CVS-2006-11-05 (CVS) OS: Linux
Private report: No CVE-ID: None
 [2006-11-05 03:50 UTC] crrodriguez at opensuse dot org
Currently there is no  --with-libzip-dir to easily allow distributions to use independantly packaged system libraries.

Reproduce code:
./configure --help | grep zip

Expected result:
--enable-zip        Include Zip read/write support.
--with-zlib-dir=DIR   zip: Set the path to libz install prefix.
--with-libzip=DIR     zip : path to libzip sources if not using the bundled library.

Actual result:
--enable-zip        Include Zip read/write support.
--with-zlib-dir=DIR   zip: Set the path to libz install prefix.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-05 19:21 UTC]
There is no need of it. And no, you should *really* not use an external library.

The version bundled have more fixes and features than the released lib. Most of them are already in the libzip cvs, other not.
 [2011-04-06 08:33 UTC] oeriksson at mandriva dot com
With the recent security flaws related to libzip it's desirable to enable this option. Isn't the latest going to work fine now?
 [2011-07-20 15:54 UTC] tcallawa at redhat dot com
It doesn't look like 0.10 will work with PHP's zip extension out of the tarball, because it is still missing some necessary features that were never upstreamed (as far as I can tell). I've worked up a patch against 0.10 that adds the necessary functionality, and sent a copy to the libzip upstream for consideration. A copy of that patch can be found here:

Then, I reworked ext/zip/config.m4 to enable an option to use libzip (the system copy). That patch is here:

I couldn't figure out a good way to test for overwrite support (the bits that the first patch add), so the configure tests will pass on a system libzip without the php changes applied, but I don't think the compile will succeed (it definitely won't work properly).
 [2011-07-20 17:40 UTC] crrodriguez at opensuse dot org
-: +: crrodriguez at opensuse dot org
 [2011-07-20 17:40 UTC] crrodriguez at opensuse dot org
tcallawa at redhat dot com : Great, patches look OK, will try them asap in openSUSE packages.
 [2011-09-28 05:35 UTC] glen at delfi dot ee
i updated the patch to really link with system libzip and not to link
with libz (as that it is libzip dependency not zip ext in case of system libzip)

i would reformat the patch indent if there's any interest it getting
applied upstream, it's currently "broken" indent just to get diffs
better to understand (and update with new upstream changes)
 [2012-06-28 19:02 UTC] tk at giga dot or dot at
The current libzip HEAD revision from the mercurial repository contains AFAICT all necessary changes for PHP. Please let me know if it doesn't.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Nov 24 06:01:23 2020 UTC