I tried to install the mongodb driver for PHP on El Capitan. While running sudo pecl install mongo, I get the error message:

sudo /Applications/XAMPP/xamppfiles/bin/pecl install mongo

fatal error: openssl/evp.h: No such file or directory
 #include <openssl/evp.h>
compilation terminated.
make: *** [io_stream.lo] Error 1
ERROR: `make' failed
PEAR Version: 1.9.4 PHP Version: 5.5.28

I tried mongo driver install with PHP 5.5.26 also.

  • What does the XAMPP documentation say? Where is ssl installed? Have you installed Xcode? – Mark Oct 19 '15 at 10:38
  • I installed xcode and open ssl also using brew. The problem started after I updated from yosemite to El Capitan. I tried this with default php MAMP and XAMPP. – Parvinder Singh Oct 19 '15 at 10:52
  • Did you install ssl and Xcode after the OS upgrade? What files got moved from /usr? – Mark Oct 19 '15 at 10:56
  • Installed ssl after OS upgrade but Xcode is already there. I'm not sure abt the files as I recently moved to MAC :) – Parvinder Singh Oct 19 '15 at 11:08
  • Just seen on another mailing list and I don't have El Capitan. El Capitan does not have OpenSSL so you would need to install that which was not needed for earlier OS X. or better get XMAMP to fix this or give instructions – Mark Oct 19 '15 at 12:59

It should install the Openssl brew install openssl & brew link openssl --force

Using xcode-select --install to install commande line tools

It does work for me ^^


The solution from Scott Wiersdorf seems to worked for me https://solitum.net/openssl-os-x-el-capitan-and-brew/

install opnessl through brew

brew install openssl

Link the openssl

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .