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

Php 在XAMPP(OS X/El Capitan)上安装MongoDB驱动程序时出错,php,mongodb,xampp,osx-elcapitan,pecl,Php,Mongodb,Xampp,Osx Elcapitan,Pecl,我对XAMPP、PHP或MongoDB不是新手,但我对Mac是新手,所以设置给我带来的麻烦可能比它应该带来的要多 当我尝试从/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

我对XAMPP、PHP或MongoDB不是新手,但我对Mac是新手,所以设置给我带来的麻烦可能比它应该带来的要多

当我尝试从
/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
configure:错误:找不到OpenSSL的
错误:`/private/tmp/pear/install/mongodb/configure--with-php-config=/usr/bin/php-config'失败
因为我对Mac如此陌生,我甚至不知道如何处理这个错误。我使用了
哪个openssl
来查看是否安装了openssl,它返回了
/usr/bin/openssl


有人能建议如何解决这个问题吗?

对我有效的方法是使用Brew的OpenSSL标头:

  • 安装
  • 使用brew安装openssl:
    brew安装openssl
  • 安装pecl模块时使用openssl头文件:
    C_INCLUDE_PATH=/usr/local/opt/openssl/INCLUDE bin/pecl install mongodb