Alex.Barylski
Alex.Barylski

Reputation: 2933

GAE two entry points

I am having trouble finding the docs on how to setup two application entry points in 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)$

Gives me an error:

ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: script field for handler '/image' must be set to 'auto' for runtime php72.

I am using Symfony 4+ so I already have /public/index.php which is handling requests just fine...but I have a simple image/index.php to load images without the overhead of S4...works fine locally but pushed to cloud GAE pukes...what gives?

Upvotes: 0

Views: 61

Answers (1)

Dan Cornilescu
Dan Cornilescu

Reputation: 39814

In the php72 runtime you cannot use this statement:

    script: public/image/index.php

From Handlers element:

script

Optional. Specifies that requests to the specific handler should target your app. The only accepted value for the script element is auto because all traffic is served using the entrypoint command. In order to use static handlers, at least one of your handlers must contain the line script: auto or define an entrypoint element to deploy successfully.

So you should change public/image/index.php to auto in that statement.

Upvotes: 1

Related Questions