【问题标题】:PECL install with --configureoptions not working - Memcache使用 --configureoptions 安装 PECL 不起作用 - Memcache
【发布时间】:2021-09-20 07:31:51
【问题描述】:

最近,我一直在尝试在安装了brew memcached 的 OSX Catalina 上安装 pecl memcache 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 无济于事。它总是得到相同的点并且失败了。

根据我对有关软件包安装的不同主题的评论,问题似乎与pecl install 命令中的-D 选项有关,因为当我从传递参数@ 的源代码进行手动安装时987654329@ 到./configure 命令它就像一个魅力并安装包,但现在不在pecl list 安装包中列出,因此无法卸载。

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

【问题讨论】:

    标签: php macos memcached pear pecl


    【解决方案1】:

    对此的快速解决方法(通过 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 选项苦苦挣扎过 - 据我所知,它已经完全坏了。

    【讨论】:

    • 非常感谢您的回答,它完全按照预期的方式工作。对于其他关注此问题的人,我建议的唯一更改是在.bashrc.zshrc 中导出路径,以便将来使用echo "export PHP_ZLIB_DIR=/usr/local/Cellar/zlib/1.2.11 pecl install memcache" &gt; .bashrc 进行安装。并且记得在安装过程中尽可能使用sudo 以避免权限问题
    猜你喜欢
    • 1970-01-01
    • 2012-06-02
    • 2015-12-17
    • 1970-01-01
    • 1970-01-01
    • 2015-10-03
    • 2015-05-01
    • 2015-07-22
    • 1970-01-01
    相关资源
    最近更新 更多