怎样编译安装zip

2018年3月12日 由 Amon

A1. 使用PECL安装zip

下载:http://pecl.php.net/package/zip

wget http://pecl.php.net/get/zip-1.14.0.tgz && tar zxvf zip-1.14.0.tgz && cd zip-1.14.0
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-libzip=/usr/local/lib64/
make && make install

参考:http://www.uedbox.com/centos7-ziparchive-libzip/

A2. 使用PECL安装zip

pecl install zip

参考:https://answers.launchpad.net/ubuntu/+question/125672

输出:

...
Build process completed successfully
Installing '/usr/local/php/lib/php/extensions/no-debug-zts-20121212/zip.so'
install ok: channel://pecl.php.net/zip-1.13.2
configuration option "php_ini" is not set to php.ini location
You should add "extension=zip.so" to php.ini

B. 使用源码编译安装zip

官网:http://pecl.php.net/package/zip

wget http://pecl.php.net/get/zip-1.13.2.tgz
tar zxvf zip-1.13.2.tgz && cd zip-1.13.2
/usr/local/php/bin/phpize   #对应的phpize路径#
./configure --with-php-config=/usr/local/php/bin/php-config #对应的php-config路径#
make
make install

生成的模块路径:

/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/zip.so   #对应的extensions路径#

在php.ini添加

[zip]
extension_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
extension = "zip.so"
广告位
Sedo.com

评论已关闭.