【问题标题】:GAE two entry pointsGAE 两个入口点
【发布时间】:2019-11-09 18:53:16
【问题描述】:

我无法找到有关如何在 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 呕吐...什么给了?

【问题讨论】:

  • 你能把剩下的 yml 和其他配置贴出来吗?
  • 我已经添加了它是什么...我有一些变化 - 似乎都没有工作

标签: google-app-engine


【解决方案1】:

在php72运行时不能使用这个语句:

    script: public/image/index.php

来自Handlers element

脚本

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

因此,您应该在该语句中将public/image/index.php 更改为auto

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-02-25
    • 1970-01-01
    • 1970-01-01
    • 2014-07-28
    • 2013-09-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多