app.yaml mismatch in documentation with php7.3

440 views
Skip to first unread message

Jukka Hautakorpi

unread,
Jan 25, 2020, 5:19:35 PM1/25/20
to Google App Engine
I'm changing GAE app from php55 to php73

And the problem is this:

#php55:
- url: /api1/.*
  script: mod_rewrite.php
  secure: always

When my api path gets queries, everything need to go to one php-script mod_rewrite.php
this was in google's own docs:

But now when I want php73:
#php73:
- url: /api1/.*
  script: auto
  secure: always

it does not let me put anything else than auto in there anymore
"ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: script field for handler '/api1/.*' must be set to 'auto' for runtime php73."


does not give working example how to accomplish this.

It does say about entrypoint, but that's not enough because I need to have 2 "entrypoints"

/api1/.*
and norman index.php in the root,
NOT JUST ONE!

Olu

unread,
Jan 27, 2020, 12:10:27 PM1/27/20
to Google App Engine
Actually, this is the expected behavior with the PHP 7. As explained in this documentation[1], the only acceptable value for the script element in the App.yaml file is "auto" because all traffic is served using the entrypoint command. The PhP 7 Runtime simply wants you to have a Front Controller[2] in your application which would handle all routing within your application. You can view a sample implementation of the front Controller in this doc[3]. 

Similar issue was actually discussed on this Stackoverflow Thread[4]

Olu

unread,
Jan 27, 2020, 12:14:14 PM1/27/20
to Google App Engine
To add more context, you probably would have to get an entry point(rather than having two entry points) and from within this entry point, you would be able to redirect traffic as you want.
Reply all
Reply to author
Forward
0 new messages