简体   繁体   中英

Error Installing MongoDB driver on XAMPP (OS X/El Capitan)

I'm not new to XAMPP, PHP, or MongoDB, but I'm new to Mac, so getting the PHP MongoDB driver set up is causing me more trouble than it probably should.

When I try to run $ sudo pecl install mongodb from /applications/xampp/xamppfiles/bin I get this error:

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

Because I'm so new to Mac, I'm not even sure how to approach this error. I used which openssl to see if OpenSSL is installed, and it returned /usr/bin/openssl .

Can anyone suggest how to fix this problem?

What worked for me was to use the OpenSSL headers from Brew:

  1. Install brew
  2. Install openssl using brew: brew install openssl
  3. Use the openssl header file when installing the pecl module: C_INCLUDE_PATH=/usr/local/opt/openssl/include bin/pecl install mongodb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM