码迷,mamicode.com
首页 > 数据库 > 详细

ubuntu php mongodb 扩展安装 / 升级

时间:2018-08-03 16:39:42      阅读:406      评论:0      收藏:0      [点我收藏+]

标签:restart   res   service   upd   could   版本   pre   ODB   emc   

* 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 的版本变化。

ubuntu php mongodb 扩展安装 / 升级

标签:restart   res   service   upd   could   版本   pre   ODB   emc   

原文地址:http://blog.51cto.com/13523022/2154123

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!