【解决方法】The SCRAM_SHA_1 authentication mechanism requires libmongoc built with ENABLE_SSL

背景

手动安装的 PHP mongodb 扩展,但是连接 MongoDB 报标题的错误:

The SCRAM_SHA_1 authentication mechanism requires libmongoc built with ENABLE_SSL

问题原因

MongoDB 扩展依赖 SSL,所以,安装 SSL 就可以了。

解决方法

依次执行以下指令。

sudo apt-get install -y libcurl4-openssl-dev pkg-config libssl-dev
sudo pecl uninstall mongodb
sudo pecl install mongodb

安装完成记得重启 php

sudo service php7.1-fpm restart

以上。

你可能感兴趣的:(运维,解决方法,php)