代码之家  ›  专栏  ›  技术社区  ›  Kenny Wyland

将ext-stackdriver\u调试器添加到composer以启用Google App Engine中的stackdriver调试

  •  0
  • Kenny Wyland  · 技术社区  · 7 年前

    我将遵循本页上的步骤: https://cloud.google.com/debugger/docs/setup/php

    我想为appengineflexibleenvironment(php7.2)设置调试。

    第三步是添加 Add the Stackdriver Debugger PHP extension via your composer.json file: 使用以下命令:

    composer require ext-stackdriver_debugger:*
    

    但是,当我运行它时,找不到包:

    [InvalidArgumentException]                                                                                                                                                   
      Could not find a matching version of package ext-stackdriver_debugger. Check the 
      package spelling, your version constraint and that the package is available in a
      stability which matches your minimum-stability (stable).  
    

    如何成功完成步骤3?

    1 回复  |  直到 7 年前
        1
  •  2
  •   rob006    7 年前

    这种错误通常意味着在所使用的PHP版本中没有启用扩展/模块 composer php.ini 由PHP CLI使用。或者,您可以显式地使用特定的PHP版本来运行 作曲家 命令:

    /usr/bin/php7.2 composer require ext-stackdriver_debugger:*
    

    composer.json :

    "require": {
        "ext-stackdriver_debugger": "*",
        ...
    },
    

    使用 --ignore-platform-reqs 打开 composer update composer install . 或者忽略这一步-需要PHP扩展除了防止在没有此扩展的服务器上安装包之外,不会给您带来任何真正的好处。您不需要将PHP扩展添加到 编写器.json 使用它。