Apple removed the OpenSSL header files in "El Capitan", making it hard to build OpenSSL-dependent libraries without modifying your system a little bit.
I find a solution for it https://solitum.net/openssl-os-x-el-capitan-and-brew/
$ cd /usr/local/include
$ ln -s ../opt/openssl/include/openssl
If you're installing MongoDB Driver for XAMPP on OSX, this will be helpful for you.
The Apache will not start with success build and install MongoDB Driver from pecl. YOu can get the source code and re-build it with option --with-mongodb-sasl=no
$ cd /path/to/mongo-php-driver
$ phpize
$ ./configure --with-mongodb-sasl=no
$ make clean && make all && make install
Some issues when install mongodb extension PHP mongodb/mongo-php-driver#247
$ git clone https://github.com/mongodb/mongo-php-driver.git
$ cd mongo-php-driver
$ git submodule sync && git submodule update --init
$ phpize
$ export LDFLAGS=-L/usr/local/opt/openssl/lib
$ export CPPFLAGS=-I/usr/local/opt/openssl/include
$ ./configure --with-mongodb-sasl=no
$ make all -j 5
$ make install