Marcatectura
Marcatectura

Reputation: 1695

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?

Upvotes: 3

Views: 847

Answers (1)

Erwin Wessels
Erwin Wessels

Reputation: 3113

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

Upvotes: 3

Related Questions