Composer找不到mongodb扩展名

时间:2016-04-22 04:47:34

标签: php mongodb laravel-5

执行composer时需要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.

问题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].

要启用扩展程序,请验证它们是否已在这些.ini文件中启用

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

您也可以在终端内运行php --ini以查看我们是哪些文件 P在CLI模式下。

  

安装失败,将./composer.json恢复为原始内容。

我正在运行Windows 7和PHP 5.5.12使用mongodb 3.2。我安装了mongodb扩展(PHP ext /文件夹中的php_mongodb.dll),我用extension = php_mongodb.dll更新了php.ini。不确定我错过了什么

1 个答案:

答案 0 :(得分:2)

pecl有两种驱动程序

enter image description here

您需要安装 mongoDB数据库驱动程序。正如您所解释的那样,您似乎已经为PHP安装了mongoDB驱动程序,这是不正确的

你必须在你的php.ini

中添加php_mongo.dll
extension=php_mongo.dll

解释here

here

获取正确的DLL

你将在phpinfo();

中得到类似的东西

enter image description here

我希望这会有所帮助。谢谢,