Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'openssl/evp.h' file not found OS x Mongodb

Having a mare with this. I'm trying to install the latest PHP mongo DB Drivers. I've looked everywhere and tried everything suggested but it will not get passed this error:


In file included from /private/tmp/pear/install/mongodb/src/contrib/php-ssl.c:31:
/private/tmp/pear/install/mongodb/src/contrib/php-ssl.h:33:10: fatal error: 'openssl/evp.h' file not found
include <openssl/evp.h>
         ^
1 error generated.
make: *** [src/contrib/php-ssl.lo] Error 1
ERROR: `make' failed

My system / setup:

OS X El Capitain v 10.11.6
PHP 7.1.0
Apache

I'm using this command to install it: sudo pecl install mongodb

I've tried the:

$ brew install openssl
$ brew link openssl --force

but that no longer works...and any of the latest workarounds for that do not work either

I've even tried going "rootless" but to no avail.

like image 352
Ben Summerhayes Avatar asked Nov 03 '16 00:11

Ben Summerhayes


1 Answers

This solution worked for me. If you don't already have openssl then first run brew install openssl. Then run:

$ cd /usr/local/include 
$ ln -s ../opt/openssl/include/openssl .
like image 69
ierdna Avatar answered Sep 20 '22 08:09

ierdna