OpenSSL not found on MacOS Sierra

I am trying to install the MongoDB PHP driver, but the installation fails because it cannot find 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 any way to do this since I really need to install this driver.

+7
source share
3 answers

You need to install OpenSSL using homebrew and tell homebrew to create the necessary symbolic links:

brew install openssl
brew link openssl --force

If you do not 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 above all, if you have not installed Xcode and the Xcode command line tools:

xcode-select --install
+5

, .

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

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

+5

C_INCLUDE_PATH, openssl.

, :

sudo C_INCLUDE_PATH=/usr/local/opt/openssl/include pecl install mongo


: charles.lescampeurs.org

+1

Source: https://habr.com/ru/post/1668825/


All Articles