[英]Adding ext-stackdriver_debugger to composer to enable StackDriver debugging in Google App Engine
I'm following the steps on this page: https://cloud.google.com/debugger/docs/setup/php我正在按照此页面上的步骤操作: https : //cloud.google.com/debugger/docs/setup/php
I want to set up the debugging for App Engine flexible environment (PHP 7.2).我想为 App Engine 柔性环境 (PHP 7.2) 设置调试。
Step 3 says to add the Add the Stackdriver Debugger PHP extension via your composer.json file:
with the following command:第 3 步说Add the Stackdriver Debugger PHP extension via your composer.json file:
使用以下命令:
composer require ext-stackdriver_debugger:*
However, when I run that, the package cannot be found:但是,当我运行它时,找不到包:
[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).
How can I complete Step 3 successfully?如何成功完成第 3 步?
Such error usually means that extension/module is not enabled in PHP version used by composer
command.此类错误通常意味着在composer
命令使用的 PHP 版本中未启用扩展/模块。 Make sure that you've enabled module in php.ini
used by PHP CLI.确保您已在 PHP CLI 使用的php.ini
启用模块。 Alternatively you may explicitly use specific PHP version to run composer
command:或者,您可以明确使用特定的 PHP 版本来运行composer
命令:
/usr/bin/php7.2 composer require ext-stackdriver_debugger:*
In worst case you may try to add extension manually to composer.json
:在最坏的情况下,您可以尝试手动将扩展添加到composer.json
:
"require": {
"ext-stackdriver_debugger": "*",
...
},
and use --ignore-platform-reqs
switch on composer update
and composer install
.并使用--ignore-platform-reqs
打开composer update
和composer install
。 Or just ignore this step - requiring PHP extension does not give you any real benefits except preventing installing package on server without this extension.或者只是忽略这一步 - 需要 PHP 扩展不会给你任何真正的好处,除了阻止在没有这个扩展的服务器上安装包。 You don't need to add PHP extension to composer.json
to use it.您无需向composer.json
添加 PHP 扩展即可使用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.