在安装pecl_http(Mac OS)时,pecl找不到zlib。

3

我正在尝试安装pecl_http,但是失败了并显示以下信息:

...
checking for zlib... no
checking whether zlib version  >= 1.2.0.4... configure: error: no
ERROR: `/private/tmp/pear/install/pecl_http/configure --with-php-config=/usr/local/opt/php@8.0/bin/php-config --with-http-zlib-dir=/usr/local/Cellar/zlib/1.2.11/include --with-http-libcurl-dir=/usr --with-http-libevent-dir=/usr --with-http-libicu-dir=/usr --with-http-libidn2-dir=/usr --with-http-libidn-dir=/usr --with-http-libidnkit2-dir=/usr --with-http-libidnkit-dir=/usr' failed

当然,我通过 brew install zlib 安装了zlib。

Warning: zlib 1.2.11 is already installed and up-to-date.
To reinstall 1.2.11, run:
  brew reinstall zlib

我还尝试了以下操作:

  1. 重新安装php
  2. 重新安装zlib
  3. pecl install pecl_http --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/include
  4. pecl install pecl_http --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/include/zlib.h
  5. pecl install pecl_http -> ...在哪里找到zlib [/usr] : /usr/local/Cellar/zlib/1.2.11/include...

我没有更多的想法,请告诉我你的想法。谢谢。

1个回答

0

你可以直接给出 zlib 文件夹。

对我来说,它是 /opt/homebrew/opt/zlibbrew info zlib 给了我这个答案:

$ brew info zlib
[...]
For compilers to find zlib you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/zlib/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/zlib/include"
[...]

请参见:

where to find zlib [/usr] : /opt/homebrew/opt/zlib

用:

$ ls -al /opt/homebrew/opt/zlib
lrwxr-xr-x  1 guillaume  admin  21 Oct 25 23:07 /opt/homebrew/opt/zlib -> ../Cellar/zlib/1.2.13

$ ls -al /opt/homebrew/Cellar/zlib/1.2.13 
total 200
drwxr-xr-x  10 guillaume  admin    320 Feb 24 16:35 .
drwxr-xr-x   3 guillaume  admin     96 Oct 25 23:07 ..
drwxr-xr-x   3 guillaume  admin     96 Oct 13 07:06 .brew
-rw-r--r--   1 guillaume  admin  82522 Oct 13 07:06 ChangeLog
-rw-r--r--   1 guillaume  admin    975 Feb 24 16:35 INSTALL_RECEIPT.json
-rw-r--r--   1 guillaume  admin   1002 Oct 13 07:06 LICENSE
-rw-r--r--   1 guillaume  admin   5368 Oct 13 07:06 README
drwxr-xr-x   4 guillaume  admin    128 Oct 13 07:06 include
drwxr-xr-x   7 guillaume  admin    224 Oct 25 23:07 lib
drwxr-xr-x   3 guillaume  admin     96 Oct 13 07:06 share

帮助过我的来源:https://github.com/m6w6/ext-http/issues/106


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接