安装之前先检车服务器是否 安装了 libzip (安装libzip 需要 cmake)
最新版本请参考官网:https://nih.at/libzip/
wget https://libzip.org/download/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0.tar.gz
mkdir build && cd build && /usr/local/bin/cmake .. && make && make install
如果报错
CMake Error at CMakeLists.txt:4 (CMAKE_MINIMUM_REQUIRED):
CMake 3.0.2 or higher is required. You are running version 2.8.12.2
-- Configuring incomplete, errors occurred!
说明cmake版本过低,需新版本
yum remove cmake
yum install -y cmake3
cmake -version
wget http://pecl.php.net/get/zip-zip-1.17.1.tgz
tar -zxvf zip-zip-1.17.1.tgz
cd zip-zip-1.17.1
/usr/local/php/phpize #注意改成自己的php路径
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
编辑php.ini 文件
zlib.output_compression = On
extension=zip.so
记得重启服务哦! |