在linux上安装php zip

6 php zip

>pecl install zip
Run Code Online (Sandbox Code Playgroud)

得到以下错误:

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
Run Code Online (Sandbox Code Playgroud)

这是什么意思?

Leo*_*onG 12

PHP zip功能依赖于ZLIB库,您需要先安装它.

  • 在ubuntu上:`apt-get install zlib1g-dev` (24认同)
  • @MichaelOsl你的评论应该被接受答案 (4认同)
  • 我在 apt 中查找,确实有正常的 zlib1g(减去 -dev),我认为这是正确的安装...我安装了您推荐的那个,一切都很好。仅供我参考,库及其 -dev 版本之间有什么区别? (2认同)