Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenSSL not found on MacOS Sierra

I am trying to install a PHP MongoDB driver but the installation is failing because it cannot locate the OpenSSL.

/Users/username/mongo-php-driver/src/libmongoc/src/mongoc/mongoc-crypto-openssl.c:24:10: fatal error: 'openssl/sha.h' file not found
#include <openssl/sha.h>
         ^
1 error generated.
make: *** [src/libmongoc/src/mongoc/mongoc-crypto-openssl.lo] Error 1

I read that this has something to do with the latest version of MacOS? Is there a way to do it, as I really need to install this driver.

like image 905
ignite-me Avatar asked Feb 04 '17 18:02

ignite-me


2 Answers

This is the only solution that worked for me.

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

Source: https://www.anintegratedworld.com/mac-osx-fatal-error-opensslsha-h-file-not-found/

like image 94
5ive Avatar answered Oct 16 '22 21:10

5ive


You’ll need to install OpenSSL using homebrew, and tell homebrew to create symlinks:

brew install openssl
brew link openssl --force

If you don’t already have homebrew installed, you can get it by running this:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

And before all that, if you haven’t already installed XCode and the XCode command-line tools:

xcode-select --install
like image 22
sideshowbarker Avatar answered Oct 16 '22 20:10

sideshowbarker