使用“gcloud app deploy”在 GCP 上部署 laravel 时出现以下错误。
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build ID~~~ status: FAILURE
Error ID: 5888fcc4
Error type: UNKNOWN
Error message: Loading composer repositories with package information
Installing dependencies from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- This package requires php ^7.3 but your HHVM version does not satisfy that requirement.
Problem 2
- Installation request for laravel/framework v8.2.0 -> satisfiable by laravel/framework[v8.2.0].
- laravel/framework v8.2.0 requires php ^7.3 -> your PHP version (7.2.33) does not satisfy that requirement.
Problem 3
- Installation request for nunomaduro/collision v5.0.2 -> satisfiable by nunomaduro/collision[v5.0.2].
- nunomaduro/collision v5.0.2 requires php ^7.3 -> your PHP version (7.2.33) does not satisfy that requirement.
Problem 4
- laravel/framework v8.2.0 requires php ^7.3 -> your PHP version (7.2.33) does not satisfy that requirement.
- laravel/tinker v2.4.2 requires illuminate/console ^6.0|^7.0|^8.0 -> satisfiable by laravel/framework[v8.2.0].
- Installation request for laravel/tinker v2.4.2 -> satisfiable by laravel/tinker[v2.4.2].
php -v
PHP 7.3.22-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Sep 9 2020 06:46:30) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.22, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.22-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
我还检查了 php 版本,但我能够确认它是 7.3
我检查了 composer.json 并在 7.3 中指定
"require": {
"php": "^7.3",
},
我参考网上的资料尝试了“composer install”、“composer update”和“composer upgrade”,但问题没有解决。
我检查了这个站点以了解如何部署
您能否再次确认您在 app.yaml 文件中放入的 php 版本是什么?
此外,如果您在 composer.json 文件中指定了所需的 PHP 版本,则必须删除该元素才能成功部署。