Php ZIP function


I need the ability to manage zip files from PHP.

Do you know the ZIP package to install ?

Do we absolutly have to compile php from source to add something like with-zip=

Thanks for your help


You’ll need zip and/or zip-devel most likely Pascal, and you will have to recompile from source. I’d just take the 4.3.11 SRPM and use it as your base, it’ll make the process much easier than doing it from scratch.


Thanks Chris.

The zip and zip-devel may be found in the PECL web site ? I only know the Zziplib. What is the zip-devel ? isn’t it a perl module ?

Also does gzopen couldn’t open a zip file ?

Or is there in PEAR a zip class ? in this case I won’t have to recompile the php as I think it is already compiled with-pear.

And last you’ll be very cool if you could provide me an example or a little howto to take the 4.3.11 SRPM as my base and recompile from it PHP



Do you need zip access or access to gzopen Pascal? gzopen is part of zlib which is included in the default IWorx-CP RPM.

The zip packages should be installable via YUM (yum install zip).

Get back to me on that 1st point and if you still need the zip functions (not gzopen) I’ll walk you through the recompile.


It’s the zip not gzopen,
(but I’ve seen some php classes that read some .zip and .gz using gzopen / zlib files : so I’ve been a little disapointed)

Also maybe it could be more easy to use or or the pear zip.php class and not to have to recompile php ?

The zip packages should be installable via YUM (yum install zip).

Hmmm ? are you sure the zip package is the php library ? I already have a zip package installed on my box but I don’t think it is the php one ?

Looking in Installed Packages:
Name Arch Version Repo

zip i386 2.3-16.1 db

Thanks for your help Chris :slight_smile:


Get back to me on that 1st point and if you still need the zip functions (not gzopen) I’ll walk you through the recompile.

Ok I have downloaded the zziplib and zziplib-devel,


I"ve found the SDL and SDL-devel package in YUM but not zziplib nor zziplib-devel

now I’m ready to change the php RPM to recompile it with with-zip=

I’ll do this :

rpm -Uvh

then update the SPECS file

-to change the Bversion to 101

-to add the with-zip option
Do I have only to add under the ./configure line
the option --with-zip= \

I’m not sure if I have to define the directory or not with --with-zip=[dir]
Indeed I have only these zziplib directory after having installed the rpm


Which one I have to enter after --with-zip=
/usr/share/zziplib ?

I imagine that the build action will try to find a C programm ? something like zziplib.c isn’t it ? but I can’t find it



rpmbuild -bb --with cos3x /usr/src/redhat/SPECS/php.spec

And finally

rpm -Uvh php-4.3.11-101.iworx.src.rpm

do I have also to Upgarde all other php-xxx rpm generated by the rebuild from spec ?


But I’m not sure what I have to update in the php.spec file

Could you please confirm me this is ok and/or give me a biref howto to perform this chris


Ok apparently everything is fine :

Now I have zip support enabled. I just have to test it now :slight_smile:

Also, I have installed ALL rpm generated


I have tested the ZIP finctions and it works great

Thanks Chris to gave me the idea to use the SPEC file :slight_smile:


Google found this thread in the forums graveyard :slight_smile:

Is there a php package that I can install now like I have with other addons?

like yum install php-zip?

Unfortunately no Justec :(. You’ll have to recompile as Pascal did to get it working.


Thanks for the quick reply Chris… Decided to just go with system(“unzip file”) since I just needed to unzip a file.