Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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??

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

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
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
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).

share|improve this answer
    
You need make and wget to run the above....yum install wget make -y will make sure you have them. –  Joshua Enfield Sep 3 '10 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 :( –  SalmanPK Sep 4 '10 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. –  Joshua Enfield Sep 5 '10 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. –  Joshua Enfield Sep 5 '10 at 11:07
    
ahh so i cant run a configure command on existing installation :(. –  SalmanPK Sep 5 '10 at 13:27
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.