首页 > 解决方案 > 使用特定 PHP 版本部署到 AppEngine (Flex) 时出现问题

问题描述

从昨天开始,我无法将我的 PHP 5.6.* 应用程序的新版本部署到 Google Cloud App Engine,默认情况下设置为 PHP 7.2.*

在 composer.json 我确实需要正确的版本,这是消息

Step #0: There is no PHP runtime version specified in composer.json, or
Step #0: we don't support the version you specified. Google App Engine
Step #0: uses the latest 7.2.x version.

作曲家.json

{
        "require": {
                "php": "5.6.*",
                "ext-mcrypt": "*",
                "ext-imagick": "*",
                "ext-mysql": "*",
                "ext-zip": "*",
                "ext-gd": "*",
                "ext-mbstring": "*",
                "ext-soap": "*",
                "ext-bcmath": "*",
                "ext-zip": "*",
                "ext-curl": "*",
                "ext-pdo_mysql": "*"
        }
}

在文档中明确表示它应该可用 https://cloud.google.com/appengine/docs/flexible/php/runtime?hl=en

yaml 文件

runtime: php
api_version: 1
service: app-ecom-worker
env: flex

skip_files:
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?\..*$
- ^(.*/)?Plugin(.*/)?webroot/
- ^(.*/)?queue.yaml
- ^(.*/)?ZohoReports/UploadTool/jre/lib/rt.jar

env_variables:
  PARAM1: "production"
  PARAM2: "10.72.0.3"
  PARAM3: ebroot
  PARAM4: ""
  PARAM5: ebdb
  PARAM6: 10.0.0.3
  PARAM7: worker
  CPWATCH: 0
  MTNS_RPC: "x.x.x.x:8082"
  MTNS_IO: "https://app.xxxx.com:843"
  REDIS_LOG: 1
  REDIS_LOG_DB: 2
  REDIS_LOG_HOST: 10.0.0.3
  REDIS_LOG_LIMIT: 50000

beta_settings:
  cloud_sql_instances: fourth-carport-210916:us-east1:ecomexperts

runtime_config:
  document_root: app/webroot

resources:
  cpu: 2
  memory_gb: 2

automatic_scaling:
  min_num_instances: 1
  max_num_instances: 4
  cpu_utilization:
    target_utilization: 0.95

任何想法如何解决这个问题?

标签: phpgoogle-app-enginegoogle-cloud-platformgcloudapp-engine-flexible

解决方案


你需要修复

"php": "7.2.*",


推荐阅读