docker下的php:7.3-apache容器中安装zip拓展报错
docker-php-ext-install zip
...
checking for the location of zlib... configure: error: zip support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located
需要指定zlib库路径,因为zip
库是依赖zlib库的,使用php -m
发现,有zlib模块啊
于是结合错误及查找百度后,需要使用docker-php-ext-configure
命令配置
docker-php-ext-configure zip --with-zlib-dir=/usr
...
configure: error: Can not find zlib headers under "/usr"
apt-get update
# 安装zip扩展所需的依赖扩展
apt-get install -y --no-install-recommends zlib1g-dev && apt-get install -y --no-install-recommends libzip-dev
apt-get clean
# rm -rf /var/cache/apk/* && rm -rf /var/lib/apt/lists/* && apt-get autoremove
docker-php-ext-install zip