运维开发网

ubuntu php mongodb 扩展安装 / 升级

运维开发网 https://www.qedev.com 2020-04-20 17:13 出处:网络 作者:运维开发网整理
* composer 安装 mongodb 时候出现版本提示: ``` Your requirements could not be resolved to an installable set of packages. Problem 1 - mongodb/mongodb 1.4.1 requires ext-mongodb ^1.5.0 -> the reques
* composer 安装 mongodb 时候出现版本提示: ``` Your requirements could not be resolved to an installable set of packages. Problem 1 - mongodb/mongodb 1.4.1 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb has the wrong version (1.1.5) installed. - mongodb/mongodb 1.4.0 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb has the wrong version (1.1.5) installed. - mongodb/mongodb 1.3.2 requires ext-mongodb ^1.4.0 -> the requested PHP extension mongodb has the wrong version (1.1.5) installed. - mongodb/mongodb 1.3.1 requires ext-mongodb ^1.4.0 -> the requested PHP extension mongodb has the wrong version (1.1.5) installed. - mongodb/mongodb 1.3.0 requires ext-mongodb ^1.4.0 -> the requested PHP extension mongodb has the wrong version (1.1.5) installed. - Installation request for mongodb/mongodb ^1.3 -> satisfiable by mongodb/mongodb[1.3.0, 1.3.1, 1.3.2, 1.4.0, 1.4.1].
查看 php 的mongodb 扩展: echo phpinfo();

更新扩展

sudo apt-get install software-properties-common

sudo add-apt-repository ppa:ondrej/php

sudo apt-get update

apt-get install php7.0-mongodb

重启启动 apache
` sudo systemctl restart apache2.service `

重启后刷新 phpinfo 才看到 mongodb 的版本变化。
0

精彩评论

暂无评论...
验证码 换一张
取 消