【问题标题】:Composer will not work with current settingsComposer 不适用于当前设置
【发布时间】: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


【解决方案1】:

警告:PHP 启动:mongo:无法初始化模块 使用模块 API=20121212 编译的模块 使用模块 API=20131226 编译的 PHP 这些选项需要在第 0 行的 Unknown 中匹配

问题

这是一个 PHP 扩展安装问题。

该错误意味着 PHP 扩展 mongo 不适合您的 PHP 版本。 不兼容。

解决方案

之后,Composer 和所有其他 PHP CLI 应用程序应该可以正常工作了。

更新问题的答案

the requested PHP extension mongodb is missing from your system

现在,mongodb 不见了:

  1. 下载
  2. 将 php_mongodb.dll 放到扩展文件夹中
  3. 编辑您的 php.ini 以包含扩展名。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-02-28
    • 2012-09-14
    • 1970-01-01
    • 2012-11-02
    • 2022-01-21
    • 1970-01-01
    相关资源
    最近更新 更多