Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using pecl to install the Mongodb driver on OS X El Capitan (v10.11.1)

I am trying to install the php mongo driver for OS X. I've tried following these instructions to no avail.

$ which pecl -> /usr/local/Cellar/php56/5.6.13_2/bin/pecl

$ sudo pecl install mongo -> full build results here but the problem the is the error:

In file included from /private/tmp/pear/install/mongo/io_stream.c:34:
/private/tmp/pear/install/mongo/contrib/php-ssl.h:33:10: fatal error: 'openssl/evp.h' file not found
#include <openssl/evp.h>

My Xcode command-line tools are up to date (I used $ xcode-select --install to be sure).

I'm sure how to fix this problem.

like image 585
RobertJoseph Avatar asked Nov 02 '15 17:11

RobertJoseph


2 Answers

I managed to get around this by installing OpenSSL using Homebrew (as suggested here):

$ brew install openssl
$ brew link openssl --force

Then

$ sudo pecl install mongodb
like image 129
John J. Camilleri Avatar answered Nov 15 '22 03:11

John J. Camilleri


Do this

$ cd /usr/local/include 
$ ln -s ../opt/openssl/include/openssl
like image 32
Uncoke Avatar answered Nov 15 '22 03:11

Uncoke