laravel/framework v10.9.0 需要 Composer-runtime-api ^2.2 -> 在 Google App Engine 标准 php81 部署上找到了 Composer-runtime-api
P粉368878176
2023-08-26 19:40:47
<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: "php"
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: "composer"
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 "bash -c php -d 'error_reporting=24575' -r \"echo hash_file('sha384', '/layers/google.php.composer-install/composer/composer-setup-2629473669.php');\""
xxxx "bash -c php -d 'error_reporting=24575' -r \"echo hash_file('s..." (425.829387ms)
installing Composer v2.1.3
--------------------------------------------------------------------------------
Running "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"
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 "bash -c php /layers/google.php.composer-install/composer/com..." (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 "php -r echo PHP_VERSION;"
8.1.17Done "php -r echo PHP_VERSION;" (17.67139ms)
DEBUG: Current dependency hash: "xxxx"
DEBUG: Cache dependency hash: ""
DEBUG: ***** CACHE MISS: "prod dependencies"
DEBUG: No metadata found from a previous build, skipping cache.
Installing application dependencies.
--------------------------------------------------------------------------------
Running "composer install --no-dev --no-progress --no-interaction --optimize-autoloader"
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 "composer install --no-dev --no-progress --no-interaction --o..." (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 "mv -f /builder/outputs/output-1561546128934258592 /builder/outputs/output"
Done "mv -f /builder/outputs/output-1561546128934258592 /builder/o..." (16.23967ms)
ERROR: failed to build: exit status 1</pre>
<p>在我的 app.yaml 中,我只设置了运行时,如下所示:</p>
<p><code>运行时:php81</code></p>
<p>以及其他一些不相关的处理程序和环境变量。</p>
Google 在其 IssueTracker 上提供了答案,表示您可以指定:
现在在
app.yaml
中覆盖 GAE 服务上的 Composer 版本。尚未测试。
编辑: 已测试但不起作用,按照 Google 团队的建议将本地计算机上的 Google Cloud SDK 更新到最新版本 (435.0.1),但不起作用。一旦找到解决方案,将发布解决方案。
编辑2:
现在使用 Composer 版本
2.5.8
进行测试和工作。不清楚2.2.1
版本的失败是否是一个错误,但我可以使用app.yaml
中的以下配置将 Laravel 10 部署到 App Engine 标准环境>.