简体   繁体   English

作曲家找不到mongodb扩展

[英]Composer can't find mongodb extension

When executing composer require jenssegers/mongodb: 执行作曲家时,需要jenssegers / mongodb:

$ composer require jenssegers/mongodb
Using version ^3.0 for jenssegers/mongodb
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1 问题1

- jenssegers/mongodb v3.0.0 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- jenssegers/mongodb v3.0.1 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- jenssegers/mongodb v3.0.2 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- mongodb/mongodb 1.0.1 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- mongodb/mongodb 1.0.0 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- Installation request for jenssegers/mongodb ^3.0 -> satisfiable by
  ers/mongodb[v3.0.0, v3.0.1, v3.0.2].

To enable extensions, verify that they are enabled in those .ini files 要启用扩展名,请验证是否已在那些.ini文件中启用了扩展名

 - C:\wamp\bin\php\php5.5.12\php.ini

You can also run php --ini inside terminal to see which files are us P in CLI mode. 您还可以在终端内运行php --ini ,以查看在CLI模式下我们P是哪些文件。

Installation failed, reverting ./composer.json to its original content. 安装失败,将./composer.json恢复为其原始内容。

I am running Windows 7 and PHP 5.5.12 use mongodb 3.2 . 我正在运行Windows 7和PHP 5.5.12使用mongodb 3.2。 I installed the mongodb extension (php_mongodb.dll in PHP ext/ folder), and I've updated php.ini with extension=php_mongodb.dll. 我安装了mongodb扩展名(PHP ext /文件夹中的php_mongodb.dll),并用extension = php_mongodb.dll更新了php.ini。 Not sure what I've missed 不知道我错过了什么

There are two kinds of drivers available at pecl pecl提供两种驱动程序

在此处输入图片说明

You need to install the mongoDB database driver . 您需要安装mongoDB数据库驱动程序 As you explained it looks like you have installed the mongoDB driver for PHP which is not correct 正如您所解释的,看起来您已经为PHP安装了mongoDB驱动程序,但它不正确

and you have to add php_mongo.dll in your php.ini 并且您必须在php.ini中添加php_mongo.dll

extension=php_mongo.dll

as explained here 这里解释

get the proper DLL from here 这里获取正确的DLL

You will get something like this in your phpinfo(); 您将在phpinfo()中得到类似的内容;

在此处输入图片说明

I hope this helps. 我希望这有帮助。 Thanks, 谢谢,

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

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