laravel/framework v10.9.0 requires Composer-runtime-api ^2.2 -> Composer-runtime-api found on Google App Engine standard php81 deployment
P粉368878176
P粉368878176 2023-08-26 19:40:47
0
1
639
<p>尝试将 Laravel 10 应用程序部署到运行 php 8.1 的 Google Cloud 应用引擎标准环境时,会出现以下错误:</p> <p>运行标准环境时是否可以更新 Google Cloud App Engine Composer-runtime-api?</p> <p>我已经检查了文档,但没有提及在标准环境中运行的composer版本或composer-runtime-api版本或任何有关如何更改这些版本的描述。</p> <p>我已经尝试添加 <code>composer-runtime-api ^2.2</code> 作为依赖项,但这导致部署时显示相同的错误。</p> <p>以下是来自 Google Cloud 的构建日志的相关部分:</p> <pre class="brush:php;toolbar:false;">===> BUILDING === PHP - Runtime (google.php.runtime@0.0.2) === Using runtime version from GOOGLE_RUNTIME_VERSION: 8.1.17 DEBUG: ***** CACHE MISS: &quot;php&quot; Installing PHP Runtime v8.1.17. 2023/04/29 13:55:22 [DEBUG] GET https://dl.google.com/runtimes/ubuntu1804/php/php-8.1.17.tar.gz Warning: BOM table is deprecated in this buildpack api version, though it remains supported for backwards compatibility. Buildpack authors should write BOM information to <layer>.sbom.<ext>, launch.sbom.<ext>, or build.sbom.<ext>. Warning: BOM table is deprecated in this buildpack api version, though it remains supported for backwards compatibility. Buildpack authors should write BOM information to <layer>.sbom.<ext>, launch.sbom.<ext>, or build.sbom.<ext>. Warning: BOM table is deprecated in this buildpack api version, though it remains supported for backwards compatibility. Buildpack authors should write BOM information to <layer>.sbom.<ext>, launch.sbom.<ext>, or build.sbom.<ext>. === PHP - Composer Install (google.php.composer-install@0.0.1) === DEBUG: ***** CACHE MISS: &quot;composer&quot; 2023/04/29 13:55:27 [DEBUG] GET https://getcomposer.org/installer 2023/04/29 13:55:27 [DEBUG] GET https://composer.github.io/installer.sig -------------------------------------------------------------------------------- Running &quot;bash -c php -d 'error_reporting=24575' -r \&quot;echo hash_file('sha384', '/layers/google.php.composer-install/composer/composer-setup-2629473669.php');\&quot;&quot; xxxx &quot;bash -c php -d 'error_reporting=24575' -r \&quot;echo hash_file('s...&quot; (425.829387ms) installing Composer v2.1.3 -------------------------------------------------------------------------------- Running &quot;bash -c php /layers/google.php.composer-install/composer/composer-setup-2629473669.php --install-dir /layers/google.php.composer-install/composer/bin --filename composer --version 2.1.3&quot; All settings correct for using Composer Downloading... Composer (version 2.1.3) successfully installed to: /layers/google.php.composer-install/composer/bin/composer Use it: php /layers/google.php.composer-install/composer/bin/composer Done &quot;bash -c php /layers/google.php.composer-install/composer/com...&quot; (258.279492ms) Warning: BOM table is deprecated in this buildpack api version, though it remains supported for backwards compatibility. Buildpack authors should write BOM information to <layer>.sbom.<ext>, launch.sbom.<ext>, or build.sbom.<ext>. Warning: BOM table is deprecated in this buildpack api version, though it remains supported for backwards compatibility. Buildpack authors should write BOM information to <layer>.sbom.<ext>, launch.sbom.<ext>, or build.sbom.<ext>. === PHP - Composer (google.php.composer@0.9.1) === -------------------------------------------------------------------------------- Running &quot;php -r echo PHP_VERSION;&quot; 8.1.17Done &quot;php -r echo PHP_VERSION;&quot; (17.67139ms) DEBUG: Current dependency hash: &quot;xxxx&quot; DEBUG: Cache dependency hash: &quot;&quot; DEBUG: ***** CACHE MISS: &quot;prod dependencies&quot; DEBUG: No metadata found from a previous build, skipping cache. Installing application dependencies. -------------------------------------------------------------------------------- Running &quot;composer install --no-dev --no-progress --no-interaction --optimize-autoloader&quot; Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/vendor/symfony/console/Helper/HelperSet.php on line 112 Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///layers/google.php.composer-install/composer/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48 Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/Repository/ArrayRepository.php:286 Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/Repository/ArrayRepository.php:286 Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/Repository/ArrayRepository.php:286 Installing dependencies from lock file Verifying lock file contents can be installed on current platform. Deprecation Notice: Return type of Composer\DependencyResolver\Pool::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/Pool.php:82 Deprecation Notice: Return type of Composer\DependencyResolver\RuleSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/RuleSet.php:119 Deprecation Notice: Return type of Composer\DependencyResolver\RuleSet::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/RuleSet.php:101 Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/Decisions.php:155 Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/Decisions.php:165 Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/Decisions.php:160 Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/Decisions.php:170 Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/Decisions.php:150 Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/Decisions.php:145 Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:36 Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:46 Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:41 Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:89 Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:70 Your lock file does not contain a compatible set of packages. Please run composer update. Problem 1 - laravel/framework is locked to version v10.9.0 and an update of this package was not requested. - laravel/framework v10.9.0 requires composer-runtime-api ^2.2 -> found composer-runtime-api[2.1.0] but it does not match the constraint. Problem 2 - laravel/framework v10.9.0 requires composer-runtime-api ^2.2 -> found composer-runtime-api[2.1.0] but it does not match the constraint. - spatie/laravel-permission 5.10.1 requires illuminate/auth ^7.0|^8.0|^9.0|^10.0 -> satisfiable by laravel/framework[v10.9.0]. - spatie/laravel-permission is locked to version 5.10.1 and an update of this package was not requested. Done &quot;composer install --no-dev --no-progress --no-interaction --o...&quot; (523.780904ms) Failure: (ID: 8fe845e7) ...google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/Decisions.php:150 Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/Decisions.php:145 Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:36 Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:46 Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:41 Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:89 Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:70 Your lock file does not contain a compatible set of packages. Please run composer update. Problem 1 - laravel/framework is locked to version v10.9.0 and an update of this package was not requested. - laravel/framework v10.9.0 requires composer-runtime-api ^2.2 -> found composer-runtime-api[2.1.0] but it does not match the constraint. Problem 2 - laravel/framework v10.9.0 requires composer-runtime-api ^2.2 -> found composer-runtime-api[2.1.0] but it does not match the constraint. - spatie/laravel-permission 5.10.1 requires illuminate/auth ^7.0|^8.0|^9.0|^10.0 -> satisfiable by laravel/framework[v10.9.0]. - spatie/laravel-permission is locked to version 5.10.1 and an update of this package was not requested. -------------------------------------------------------------------------------- Running &quot;mv -f /builder/outputs/output-1561546128934258592 /builder/outputs/output&quot; Done &quot;mv -f /builder/outputs/output-1561546128934258592 /builder/o...&quot; (16.23967ms) ERROR: failed to build: exit status 1</pre> <p>在我的 app.yaml 中,我只设置了运行时,如下所示:</p> <p><code>运行时:php81</code></p> <p>以及其他一些不相关的处理程序和环境变量。</p>
P粉368878176
P粉368878176

reply all(1)
P粉128563140

Google provides an answer on its IssueTracker stating that you can specify:

build_env_variables:
  GOOGLE_COMPOSER_VERSION: 2.2.1

Now override the Composer version on the GAE service in app.yaml.

Not tested yet.

edit: Tested but not working, updated the Google Cloud SDK on my local machine to the latest version (435.0.1) as recommended by the Google team, but not working. The solution will be posted once it is found.

Edit 2:

Now using Composer version 2.5.8 for testing and working. Not sure if the failure with version 2.2.1 is a bug, but I can use app.yaml中的以下配置将 Laravel 10 部署到 App Engine 标准环境>.

build_env_variables:
  GOOGLE_COMPOSER_VERSION: 2.5.8
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template