问题
Im using plesk 12 and PHP7 on centos 7. How can i enable libmongoc ssl on my server?
回答1:
Try to compile it with
yum install git plesk-php70-devel make gcc openssl-devel
git clone https://github.com/mongodb/mongo-php-driver.git
cd mongo-php-driver/
git submodule update --init
/opt/plesk/php/7.0/bin/phpize
./configure --with-php-config=/opt/plesk/php/7.0/bin/php-config --with-mongodb-ssl=openssl
make
cp /root/mongo-php-driver/modules/mongodb.so /opt/plesk/php/7.0/lib/php/modules/
plesk bin php_handler --reread
After that in phpinfo() you will see:
libmongoc SSL enabled
libmongoc SSL library OpenSSL
libmongoc crypto enabled
libmongoc crypto library libcrypto
回答2:
I was able to get this working in php-fpm (7.1) Docker using below commands. What's important is to install libssl-dev
before installing mongodb driver.
apt-get install -y autoconf pkg-config libssl-dev
pecl install mongodb
echo "extension=mongodb.so" >> /usr/local/etc/php/conf.d/mongodb.ini
来源:https://stackoverflow.com/questions/48849166/how-can-i-enable-libmongoc-ssl