【问题标题】:Instal pecl_http: raphf installed but ./configure isn't seeing it安装 pecl_http:raphf 已安装,但 ./configure 没有看到
【发布时间】:2014-11-12 20:40:26
【问题描述】:

我正在尝试安装 pecl_http 作为 php 的扩展。

phpise 工作正常,因为我正在获取配置文件。当我输入 ./configure 时,我收到以下错误消息;

...
checking openssl/crypto.h usability... yes
checking openssl/crypto.h presence... yes
checking for openssl/crypto.h... yes
checking for gnutls support in libcurl... no
checking for ares support in libcurl... no
checking for bundled SSL CA info... /etc/ssl/certs/ca-certificates.crt
checking for event2/event.h... found in /usr
checking for libevent version, roughly... 2.0.19-stable
checking for ext/raphf support... no
configure: error: Please install pecl/raphf and activate extension=raphf.so in your php.ini

我在我的 php.ini 文件中添加了以下行

extension=raphf.so

我知道 raphf 已安装并正在加载,因为我使用以下 php 检查了它:

echo extension_loaded(raphf) ? "raphf loaded" : "raphf not loaded";

返回它已加载。

为什么 ./configure 看不到 raphf?

【问题讨论】:

  • 查看configure 脚本,了解它检查的具体内容和方式。可能只是 php.ini 位置不匹配,php 二进制文件,或者它正在寻找头文件。

标签: php pecl


【解决方案1】:

如果有人仍然对如何解决这个问题感兴趣,我只是想出了一个解决方案。 pecl_http 的配置脚本查找要启用的模块不是针对 apache php 模块,而是针对 php 命令行界面。如果你运行 php -m,你会看到 raphf 和 propro 都没有启用。要让 CLI 启用此模块,您必须添加:

extension=raphf.so
extension=propro.so

在 /etc/php5/cli/php.ini 中也是如此,因为那是 php CLI 在启动时运行的初始化文件。之后,您将解决问题。

【讨论】:

    【解决方案2】:

    在过去的几个月里,我一直在为这个问题绞尽脑汁。此问题的解决方案可能只涉及卸载模块。出于某种原因,pecl 仍然认为模块已安装,但实际上并未安装。

    因此,我的工作是确认 pecl 是否仍然认为它是使用 pecl list 安装的。如果它列出了它,则使用pecl uninstall [modulename] 卸载该模块。卸载后,我终于可以安装 raphf。

    【讨论】:

      【解决方案3】:

      我遇到了同样的问题,但德科德龙提供的解决方案并没有解决问题。这里也没有答案:Ubuntu pecl install pecl_http fail

      我发现 php-config --php-binary 返回 NONE 而不是 php 的二进制文件。因为 configure 脚本使用这个命令来获取 php 二进制文件,然后调用 $PHP_EXECUTABLE -m | $EGREP ^raphf$ 它认为 raphf 还没有加载。解决方案是操纵配置脚本,使其使用正确的 php 二进制文件。

      ~# pecl download pecl_http
      ~# tar -xf pecl_http-2.5.3.tgz
      ~# cd pecl_http-2.5.3
      ~/pecl_http-2.5.3# phpize --clean
      ~/pecl_http-2.5.3# phpize
      ~/pecl_http-2.5.3# sed "s/^PHP_EXECUTABLE=.*$/PHP_EXECUTABLE=\"\/usr\/bin\/php\"/g" -i configure
      ~/pecl_http-2.5.3# ./configure
      ~/pecl_http-2.5.3# make
      ~/pecl_http-2.5.3# make install
      

      然后将 extension=http.so 添加到您的 php.ini 中以获取 apache2 和 cli,然后您就完成了。 提示: 通常您可以使用which php 找到您的 php 二进制文件的正确路径。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-07-11
        • 1970-01-01
        • 2017-10-04
        • 2013-04-20
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多