I\'ve tried two different ways to install the mongodb php driver.
Looks like you don't have the headers installed for OpenSSL.
Try yum install openssl-devel
(or use sudo if not root) then recompile.
For anyone the command yum install openssl-devel did not solve Installing PHP56 Mongo Driver in centos instance try to use/install these first
sudo yum install php-pear
sudo yum install php56-devel
sudo yum install gcc
sudo yum install openssl-devel
sudo pecl install mongodb