How can i enable libmongoc ssl?

浪尽此生 提交于 2019-12-11 07:32:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!