php - pecl install memcache 在 OS X Yosemite 上失败,错误为 "memcache support requires ZLIB"

标签 php macos memcached libmemcache

我正在尝试执行 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/

相关文章:

php - memcache可以存储PHP中的splqueue等数据结构吗?

php - 使用 php 绘制 bargraph-jpgraph

php - 如何获得 API 响应

php - wordpress 网站上的 Firebase 身份验证

c# - Mac OS 上的 unity 3d build 问题

python - 没有 ReferenceProperty 的内存缓存实体

php - 无法连接到 docker-compose 中的数据库

php - 如何安装 APC XAMPP

objective-c - NSSlider 多次撤销注册

c# - 内存缓存通用列表删除而不影响缓存列表