GAE两个入口点

问题描述 投票:0回答:1

我在查找有关如何在GAE中设置两个应用程序入口点的文档时遇到麻烦:

    runtime: php72

    env_variables:
      APP_ENV: prod
      APP_SECRET: XXX
      # APP_DEBUG: true

      ## For connecting to Cloud SQL with Doctrine
      ## This is used in part two of the README:

      DATABASE_URL: XXX


    handlers:
      # Image DB delivery
      - url: /image
        script: public/image/index.php

      # Declare the build and bundles directory as static assets to be served by the App Engine CDN.
      - url: /build
        static_dir: public/build
      - url: /assets
        static_dir: public/assets
      - url: /bundles
        static_dir: public/bundles

      # Declare any media files in the public directory as static assets as well.
      - url: /(.*\.(ico|txt|gif|png|jpg))$
        static_files: public/\1
        upload: public/.*\.(ico|txt|gif|png|jpg)$

给我一个错误:

错误:(gcloud.app.deploy)INVALID_ARGUMENT:处理程序的脚本字段对于运行时php72,'/ image'必须设置为'auto'。

我正在使用Symfony 4+,所以我已经有/public/index.php,它可以很好地处理请求...但是我有一个简单的image / index.php来加载图像而没有S4的开销...工作正常本地,但被推向云端GAE恶作剧...给出了什么?

google-app-engine
1个回答
0
投票

在php72运行时中,您不能使用此语句:

    script: public/image/index.php

来自Handlers element

脚本

可选。指定对特定处理程序的请求应定位您的应用。 script元素唯一可接受的值是auto,因为所有流量都使用entrypoint命令提供。在为了使用静态处理程序,您的至少一个处理程序必须包含行[[script:auto或定义一个entrypoint元素以部署成功。

因此您应该在该语句中将public/image/index.php更改为auto。>>
© www.soinside.com 2019 - 2024. All rights reserved.