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

2

11

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.

Appellate answered 3/11, 2016 at 0:36 Comment(5)
I've been pulling my hair out for a whole week over this. Any help is appreciated!Soubriquet
I'm still no further forward with this. Think I'm going to set up a dev server on a raspberry pi at this rate.Appellate
I ended up getting annoyed and completely removing my Apache and PHP installation, and then reinstalling. All good nowSoubriquet
gave up...went back to ubuntu.Appellate
Solutions below didn't work for me. Running on Catalina 10.15.6Hawley
S
30

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 .
Senegambia answered 19/7, 2017 at 16:30 Comment(2)
Worked for me tooCalmative
Worked for me on an unrelated build (promark3) which had the same error ('openssl/evp.h' file not found)Ravelment
A
2

Two things are required. The one suggested by @ierdna was what was required for me to work, but only after I performed the following

~$ brew install openssl
~$ brew info openssl

Do the exporting as told by brew

~$ export LDFLAGS="-L/usr/local/opt/openssl/lib"
~$ export CPPFLAGS="-I/usr/local/opt/openssl/include"

Then do what ierdna tells you..

~$ cd /usr/local/include
~$ ln -s ../opt/openssl/include/openssl .

It worked for me immediately

Assurance answered 10/1, 2020 at 4:18 Comment(1)
please work on that edit queueSvoboda

© 2022 - 2024 — McMap. All rights reserved.