laravel/framework v10.9.0 需要 Composer-runtime-api ^2.2 -> 在 Google App Engine 标准 php81 部署上找到了 Composer-runtime-api[2.1.0]

2024-01-04

尝试将 Laravel 10 应用程序部署到运行 php 8.1 的 Google Cloud 应用程序引擎标准环境时,会出现以下错误:

有没有办法在运行标准环境时更新谷歌云应用程序引擎composer-runtime-api?

我查过the docs https://cloud.google.com/appengine/docs/standard/php-gen2/specifying-dependencies但没有提及在标准环境中运行的composer版本或composer-runtime-api版本,也没有任何关于如何更改这些版本的描述。

我已经尝试添加composer-runtime-api ^2.2作为依赖项,但这导致在部署时显示相同的错误。

以下是来自 Google Cloud 的构建日志的相关部分:

===> BUILDING
=== PHP - Runtime ([email protected] /cdn-cgi/l/email-protection) ===
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 ([email protected] /cdn-cgi/l/email-protection) ===
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 ([email protected] /cdn-cgi/l/email-protection) ===
--------------------------------------------------------------------------------
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

在我的 app.yaml 中,我只设置了运行时,如下所示:

runtime: php81

以及其他一些不相关的处理程序和环境变量。


谷歌在他们的 IssueTracker 上提供了一个答案,说你可以指定:

build_env_variables:
  GOOGLE_COMPOSER_VERSION: 2.2.1

In the app.yaml现在覆盖 GAE 服务上的 Composer 版本。

尚未测试。

编辑: 已测试但不起作用,按照 Google 团队的建议将本地计算机上的 Google Cloud SDK 更新到最新版本 (435.0.1),但不起作用。一旦找到解决方案,将发布解决方案。

Edit 2:

使用 Composer 版本时立即测试并工作2.5.8。不清楚是否版本失败2.2.1是一个错误,但我可以使用以下配置将 Laravel 10 部署到 App Engine 标准环境app.yaml.

build_env_variables:
  GOOGLE_COMPOSER_VERSION: 2.5.8
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

laravel/framework v10.9.0 需要 Composer-runtime-api ^2.2 -> 在 Google App Engine 标准 php81 部署上找到了 Composer-runtime-api[2.1.0] 的相关文章

  • 使用 ImapMailbox.php 按日期对 Imap 邮箱进行排序

    我有一个客户支持系统 它会在收到电子邮件时创建电子邮件 我曾经使用后缀和特殊配置来获取电子邮件以添加额外的功能 例如 我想包含从电子邮件发送的附件 系统不会执行此操作 而是创建一封带有主题的电子邮件 因此我可以通过匹配主题来包含附件 我使用
  • 使用 PHP 分割逗号分隔名称

    我的名字格式为姓氏 名字 在我的数据库中 第一个和最后一个字段都有不同的字段 我想使用 PHP 读取逗号之前的所有内容作为姓氏 以及逗号之后的所有内容作为名字 实现这一目标的最佳方法是什么 list Lastname Firstname e
  • CodeIgniter/PHP - 从视图内调用视图

    基本上 对于我的网络应用程序 我正在尝试更好地组织它 目前 每次我想加载页面时 我都必须从控制器中执行此操作 如下所示 this gt load gt view subviews template headerview this gt lo
  • 如何在 SQLite 中获取最后插入的 ID?

    SQLite 中是否有任何内置函数可以获取最后插入的行 ID 例如 在 mysql 中我们有LAST INSERT ID 这种功能 对于 sqlite 任何可用于执行相同过程的函数 请帮我 Thanks SQLite 这可以使用SQLite
  • 如何在PHP中完成http响应并进行进一步处理?

    就我而言 我需要向客户端回显一个标志并发送一封电子邮件 现在客户端需要等待电子邮件发送 但我想把这两个步骤分开 该怎么做呢 你可以看一下异步运行 PHP 任务 https stackoverflow com questions 858883
  • PHP正则表达式替换链接url

    我需要添加href 之前http 如果这http 不遵循href or src 以下代码部分有效 部分意味着它考虑 a href 只但不src a s i a href target blank gt 0 a str 预先感谢各位的回复 s
  • 在 PHP 中使用可变变量是不好的做法吗?

    例如 一个简单的MVC类型系统 api class method使用重写为 PHP 变量 htaccess nginx conf 然后做类似的事情
  • 带摘要的 php curl 返回两个响应

    我发现了一个 奇怪 的 php CURL 行为 这让我抓狂 基本上我正在做的是使用curl 进行摘要身份验证的调用 这是我的代码的摘录 curl setopt this gt c CURLOPT HTTPAUTH CURLAUTH DIGE
  • 如何捕获反序列化异常?

    PHP 是否可以在以下情况下捕获异常 unserialize 产生错误 一个简单的方法是 ret unserialize foo if ret null Error case 但这不是最现代的解决方案 最好的方法是像前面提到的那样有一个自定
  • 从 PHP 启动守护进程

    对于网站 我需要能够启动和停止守护进程 我目前正在做的是 exec sudo etc init d daemonToStart start 守护进程已启动 但 Apache PHP 挂起 做一个ps aux透露sudo它本身变成了僵尸进程
  • zend框架验证模型中的数据而不是表单中的数据

    使用 Zend Framework 2 在我的应用程序中 要编辑数据库中的数据 可以编译 html 表单或发送 http post 请求 我的服务器作为 Web 服务实现 在第二种情况下 不会呈现表单 问题 如果当服务器收到不是从表单发送而
  • 从 Android 访问云存储

    我一直无法找到任何有关如何从 Android 应用程序使用云存储的具体文档 我确实遇到过这个客户端库 https cloud google com storage docs reference libraries然而 Google Clou
  • Laravel 5.1 Snappy pdf 图像未在 pdf 文件中呈现

    我在用barryvdh laravel snappy生成pdf文件 我有两个图像文件 1 yourlogohere png 位于 public image 文件夹中 2 logo2 png 位于 public app logo 以外的文件夹
  • PHP 中正确的存储库模式设计?

    前言 我尝试在具有关系数据库的 MVC 架构中使用存储库模式 我最近开始学习 PHP 中的 TDD 并且我意识到我的数据库与应用程序的其余部分耦合得太紧密 我读过有关存储库并使用国际奥委会容器 http laravel com docs 4
  • 什么是 PHP session_start()

    它是否基于 cookie 启动当前会话 从 PHP 网站上得到的 PHP如何控制会话 如果我在用户打开我的登录页面时启动会话 我什至可以使用该会话做什么 我可以使用当前会话来获取有关登录用户的信息吗 PHP 会话系统允许您将数据安全地存储在
  • 使用 yaml 路由描述时如何在运行时获取 Symfony2 中的路由名称?

    在这里你可以找到我的n关于 Symfony2 的第一个问题 我正在与一个分页捆绑 https github com makerlabs PagerBundle wiki使用中提供的路由名称routing yml文件 从我的角度来看 这种方法
  • Nginx 安全链接模块不适用于 php 文件,但适用于静态文件

    我在用http nginx org en docs http ngx http secure link module html http nginx org en docs http ngx http secure link module
  • 在 Elasticsearch php API 中使用多种类型或索引

    我想使用查询多种类型和索引Elasticsearch PHP API 但我不知道怎么办 我应该将类型和索引的数组传递给 params params index index array of indices params type types
  • SimpleXML 返回空数组

    我正在尝试使用 Google Maps API 和 PHP SimpleXML 获取城市的纬度和经度 我尝试这样做 xml simplexml load file http maps googleapis com maps api geoc
  • jQuery appendTo(), json 在 IE 6,7,8 中不起作用

    我这两天绞尽脑汁想找到解决办法 我使用 jQuery ajax 从数据库中获取值 以便在另一个框发生更改时更新一个框 php 脚本从数据库中获取值 然后输出 json 它在 FF 中工作正常 但在所有版本的 IE 中 选择框都不会更新 我已

随机推荐