简体   繁体   中英

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

I want to set up the debugging for App Engine flexible environment (PHP 7.2).

Step 3 says to add the Add the Stackdriver Debugger PHP extension via your composer.json file: with the following command:

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?

Such error usually means that extension/module is not enabled in PHP version used by composer command. Make sure that you've enabled module in php.ini used by PHP CLI. Alternatively you may explicitly use specific PHP version to run composer command:

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

In worst case you may try to add extension manually to composer.json :

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

and use --ignore-platform-reqs switch on composer update and 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. You don't need to add PHP extension to composer.json to use it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM