Hi i am having a big problem, i have a vps with centos installed on it. But i have a script which needs php zip library i checked on php.net it says "In order to use these functions you must compile PHP with zip support by using the --enable-zip configure option." i have PHP Version 5.2, Please Guide me how am i going to do that??

1 Answer 1


At command line:

wget [link to php goes here]
tar -xvf [file you downloaded goes here]
cd [name of file without the extension\folder that was just extracted to]
./configure --enable-zip
make install

In convenient batch form that you should be able to copy and paste:

yum install -y make wget gcc zip-devel bzip2-devel
wget http://us3.php.net/get/php-5.2.14.tar.gz/from/this/mirror
tar -xvf php-5.2.14.tar.gz
cd php-5.2.14
./configure --enable-zip
make install

If the configure fails....

The configure may fail - if it does you most like need the devel library of what is missing (look at the output.) If it is bzip for example you would use the command

yum install bzip-devel

In your case it might be something like

yum install zip-devel

This should give you an idea of what you need if the above does not work.

yum search zip 

After doing this simply continue at the configure step above that failed (if it fails the first itme through).

  • You need make and wget to run the above....yum install wget make -y will make sure you have them. Commented Sep 3, 2010 at 20:12
  • I tried yum search zip and got many results 2 of them were zip.i386 and zip-devel and both were already installed. Please tell me how to run this configure command on my exisiting php installation i have kloxo admin panel installed :(
    – Salman
    Commented Sep 4, 2010 at 1:30
  • I don't believe you can run the configure on an existing install. The configure command is a setup procedure for an install from source. The zip-devel is used when the zip option is enabled to compile it into the install. Commented Sep 5, 2010 at 10:55
  • You will need to reinstall PHP from source. You can use the batch script above to do this, replacing the 5.2.14 link with 5.2.13 if you want that specific version instead. If you don't want to do this, I am unsure of any way to enable the options. One other library you want to make sure you have if you install from source for zip support is zlib-devel. Commented Sep 5, 2010 at 11:07
  • ahh so i cant run a configure command on existing installation :(.
    – Salman
    Commented Sep 5, 2010 at 13:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .