当 运行 ' composer require google/apiclient:"^2.0" ' 时获取错误消息

Getting the error message when running ' composer require google/apiclient:"^2.0" '

当我 运行 这个命令时 composer require google/apiclient:"^2.0" 我收到这些错误消息:

Problem 1

  • mongodb/mongodb 1.5.1 requires ext-mongodb ^1.6 -> the requested PHP extension mongodb is missing from your system.
  • mongodb/mongodb 1.5.1 requires ext-mongodb ^1.6 -> the requested PHP extension mongodb is missing from your system.
  • mongodb/mongodb 1.5.1 requires ext-mongodb ^1.6 -> the requested PHP extension mongodb is missing from your system.
  • Installation request for mongodb/mongodb (locked at 1.5.1, required as ^1.5) -> satisfiable by mongodb/mongodb[1.5.1].

To enable extensions, verify that they are enabled in your .ini files:

  • C:\PHP7\php.ini You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.

谁能向我解释为什么会这样,因为我对 Php 和作曲家还很陌生?

看起来问题是由 mongodb 扩展引起的。我不再需要 mongodb,我删除了 Php.ini 文件中的 ;extension=php_mongodb.dll

您的 composer.jsoncomposer.lock 中仍然引用了 mongodb。仔细检查您的 composer.json,删除您的 composer.lock,然后再次 运行 您的作曲家命令。