带有 --configureoptions 的 PECL 安装不起作用 - Memcache

问题描述

最近,我一直在尝试在安装了 pecl memcache 的 OSX Catalina 上安装 brew memcached PHP 扩展,每次尝试安装过程时都会收到以下错误

configure: error: memcache support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located

我已尝试使用 pecl install memcachepecl install --configureoptions='with-zlib-dir="path"' memcache 均无济于事。它总是得到相同的点,但失败了。

Screen Shot 2021-07-10 at 12 56 14 AM

根据我对有关安装包的不同主题评论,问题似乎与 -D 命令中的 pecl install 选项有关,因为当我从源代码进行手动安装时将参数 --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11 传递给 ./configure 命令,它的作用就像一个魅力并安装软件包,但现在未列在 pecl list 已安装的软件包中,因此无法卸载。

问题是我需要 pecl 来管理软件包的安装,以便在环境从项目变为保护时能够随时卸载它。

解决方法

对此的快速修复(通过 https://bugs.php.net/bug.php?id=56522 找到)是使用 PHP_ZLIB_DIR 变量而不是 --with-zlib-dir。

PHP_ZLIB_DIR=/usr/local/Cellar/zlib/1.2.11 pecl install memcache

我之前也遇到过 -D 选项的问题 - 几乎我可以说它完全坏了。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...