php安装zip

安装zip

wget http://pecl.php.net/get/zip
tar -zxvf zip
cd zip-1.x.x
phpize
./configure
make
sudo make install

修改php.ini文件

extension = /usr/local/lib/php/extensions/zip.so,然后同样在php.ini文件中,将 zlib.output_compression = Off 改为 zlib.output_compression = On ;

 

常见问题结局方案:

如遇到:configure: error: Please reinstall the libzip distributio 或  configure: error: system libzip must be upgraded to version >= 0.11。使用Yum最新版只到0.10,不足以达到要求。

yum remove libzip -y

wget https://nih.at/libzip/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make && make install

如遇到:zipconf.h: No such file or directory(找不到zip.conf.h文件)

cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h

你可能感兴趣的:(PHP)