我正在尝试执行 pecl install memcache
在 OS X Yosemite 上使用 XAMPP,但找不到 zlib
,产生这个错误:
checking for the location of ZLIB... no
checking for the location of zlib... configure: error: memcache support requires ZLIB.
Use --with-zlib-dir= to specify prefix where ZLIB include and library are located
ERROR: `/private/tmp/pear/temp/memcache/configure --enable-memcache-session=yes' failed
如何安装
zlib
以便此 pecl install memcache
能成功吗?
最佳答案
brew install zlib
如果你还没有这样做
接下来找到 zlib 头文件:
locate zlib.h
您可能会发现有几个选项可供选择。
/Applications/Xcode.app/Contents/Developer/Platforms/ etc
或者
/usr/local/Cellar/zlib/1.2.8/include/zlib.h
我尽可能使用 brew 所以我选择了 brew 版本:
brew install php55-memcached --with-zlib-dir=/usr/local/Cellar/zlib/1.2.8/include/zlib.h
我假设将此标志传递给 pecl 将具有相同的结果。
关于php - pecl install memcache 在 OS X Yosemite 上失败,错误为 "memcache support requires ZLIB",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29726890/