Composer无法使用当前设置

时间:2016-07-28 06:22:29

标签: php mongodb composer-php php-extension

您指定的PHP exe文件未正确运行:

C:\xampp\php\php.exe

您的命令行PHP使用的php.ini是:C:\xampp\php\php.ini

节目输出:

  

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

更新

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.

1 个答案:

答案 0 :(得分:0)

  

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

<强>问题

这是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以包含扩展名。