gpt4 book ai didi

php - 在 XAMPP (OS X/El Capitan) 上安装 MongoDB 驱动程序时出错

转载 作者:可可西里 更新时间:2023-11-01 09:35:27 32 4
gpt4 key购买 nike

我不是 XAMPP、PHP 或 MongoDB 的新手,但我是 Mac 的新手,所以获取 PHP MongoDB driver设置给我带来的麻烦超出了应有的范围。

当我尝试从 /applications/xampp/xamppfiles/bin 运行 $ sudo pecl install mongodb 时,我收到此错误:

configure: error: Cannot find OpenSSL's <evp.h>
ERROR: `/private/tmp/pear/install/mongodb/configure --with-php-config=/usr/bin/php-config' failed

因为我是 Mac 的新手,所以我什至不确定如何处理这个错误。我使用 which openssl 查看是否安装了 OpenSSL,它返回了 /usr/bin/openssl

谁能建议如何解决这个问题?

最佳答案

对我有用的是使用 Brew 的 OpenSSL header :

  1. 安装 brew
  2. 使用 brew 安装 openssl:brew install openssl
  3. 安装pecl模块时使用openssl头文件:C_INCLUDE_PATH=/usr/local/opt/openssl/include bin/pecl install mongodb

关于php - 在 XAMPP (OS X/El Capitan) 上安装 MongoDB 驱动程序时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34867345/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com