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??
Asked
Active
Viewed 8,869 times
1 Answers
4
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).

Joshua Enfield
- 3,454
- 8
- 42
- 59
-
You need make and wget to run the above....`yum install wget make -y` will make sure you have them. – Joshua Enfield Sep 03 '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 :( – Samuel Katz Sep 04 '10 at 01: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 05 '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 05 '10 at 11:07
-
ahh so i cant run a configure command on existing installation :(. – Samuel Katz Sep 05 '10 at 13:27
-
Anyway a Big Thaaaaaaaaaaaaaaanks for the Help :) – Samuel Katz Sep 05 '10 at 13:27
-
One last thing is if you want to keep your options in the existing PHP installation you can put ` echo phpinfo(); ?>` on one of your pages and then navigate to it. It will list all the configurations and modules in that install of PHP. Of note is the ./configure line. You can copy paste this and then append the extra options you want. Theoretically this should give you the same install with the additional enabled modules, and always glad to help :) – Joshua Enfield Sep 05 '10 at 18:06
-
But the new problem i have encountered is here http://serverfault.com/questions/178402/how-to-make-changes-to-kloxos-php-installation . if u have worked with kloxo admin panel then u will know the solution. :) – Samuel Katz Sep 06 '10 at 07:34