【发布时间】:2016-07-28 06:22:29
【问题描述】:
您指定的 PHP exe 文件没有正确运行:
C:\xampp\php\php.exe
您的命令行 PHP 使用的 php.ini 是:C:\xampp\php\php.ini
程序输出:
警告:PHP 启动:mongo:无法初始化模块
使用模块 API=20121212 编译的模块
使用模块 API=20131226 编译的 PHP
这些选项需要在第 0 行的 Unknown 中匹配
更新
Composer 在 php 中找不到 mongodb 扩展
C:\wamp\www\phpmongodb>composer require "mongodb/mongodb=^1.0.0"
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
./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
- mongodb/mongodb 1.0.2 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- mongodb/mongodb 1.0.2 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- 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.
- mongodb/mongodb 1.0.2 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- Installation request for mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1, 1.0.2].
To enable extensions, verify that they are enabled in those .ini files:
- C:\wamp\bin\php\php5.5.12\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
【问题讨论】:
-
您用新问题替换了原来的问题。不要那样做!我已恢复您的编辑,以便显示原始问题并添加您的新内容作为更新。
标签: php mongodb composer-php php-extension