简体   繁体   English

由于驱动程序丢失,无法安装yii2 mongodb扩展

[英]can't install yii2 mongodb extension because of driver missing

I'm trying to install yii2 mongodb extension, but I have this error when I run composer update 我正在尝试安装yii2 mongodb扩展,但是当我运行composer update时出现此错误

Problem 1
    - yiisoft/yii2-mongodb 2.1.1 requires ext-mongodb >=1.0.0 -> the requested PHP extension mongodb is missing from your system.
    - yiisoft/yii2-mongodb 2.1.0 requires ext-mongodb >=1.0.0 -> the requested PHP extension mongodb is missing from your system.
    - Installation request for yiisoft/yii2-mongodb ~2.1.0 -> satisfiable by yiisoft/yii2-mongodb[2.1.0, 2.1.1].

I know I need to have the driver installed but I have it, I know because of this 我知道我需要安装驱动程序,但我知道,因为这个我知道

php -i | grep mongo
/etc/php5/cli/conf.d/20-mongo.ini,
mongo
mongo.allow_empty_keys => 0 => 0
mongo.chunk_size => 261120 => 261120
mongo.cmd => $ => $
mongo.default_host => localhost => localhost
mongo.default_port => 27017 => 27017
mongo.is_master_interval => 15 => 15
mongo.long_as_object => 0 => 0
mongo.native_long => 1 => 1
mongo.ping_interval => 5 => 5

and the extension was installed trought pecl, I have this info when I run 并且扩展安装了pecl,我运行时有这个信息

pecl info mongo

About pecl.php.net/mongo-1.6.14
===============================
Release Type          PECL-style PHP extension (source code)
Name                  mongo
Channel               pecl.php.net
Summary               MongoDB database driver
Description           This package provides an interface for
                      communicating with the MongoDB database in PHP.
Maintainers           Derick Rethans <derick@php.net> (lead)
                      Hannes Magnusson <bjori@php.net> (lead)
                      Jeremy Mikola <jmikola@php.net> (lead)
Release Date          2016-04-26 16:08:28
Release Version       1.6.14 (stable)
API Version           1.6.14 (stable)

what could be reason of the error? 可能是错误的原因是什么? any help will be appreciated, thanks!! 任何帮助将不胜感激,谢谢!

解决了,基本上我不知道有多个mongo扩展安装,Yii需要的是mongodb扩展,我从自制程序安装了一个,现在一切正常,谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM