您指定的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.
答案 0 :(得分:0)
警告:PHP启动: mongo :无法初始化模块 使用模块API = 20121212编译的模块 使用模块API = 20131226编译的PHP 这些选项需要在第0行的未知中匹配
<强>问题强>
这是PHP扩展安装问题。
错误意味着PHP扩展 mongo 不适合您的PHP版本。 这是不相容的。
<强>解决方案强>
解决方案是使用php -v
检查您的PHP版本,然后安装匹配的“mongo”扩展名。
PHP扩展 Mongo https://pecl.php.net/package/mongo + http://php.net/mongo/
提醒:不推荐使用PHP扩展名Mongo。替换是MongoDB https://pecl.php.net/package/mongodb + http://php.net/mongodb/
另一个简单的解决方案是从扩展名文件夹中删除php_mongo.dll
并将其从php.ini
中删除,以便正确启动PHP。
之后,Composer和所有其他PHP CLI应用程序应该正常工作。
回答更新后的问题
the requested PHP extension mongodb is missing from your system
现在,mongodb不见了: