0
votes

How do I serve both php and static content (e.g. jpegs) from the same directory on Google App Engine? I have this app.yaml:

runtime: php55
api_version: 1

handlers:

# Serve php scripts
- url: /subdir/(.+\.php)$
  script: subdir/\1

# Serve static content
- url: /subdir/
  static_dir: subdir

I can access e.g. /subdir/test1.php and /subdir/test1.jpg just fine from a browser when I run a local server with the "dev_appserver.py" command. However, when I deploy to live instance on google app engine, only /subdir/test1.jpg is accessible (test1.php gives 404 ... which is unexpected). When I remove the last 2 lines from app.yaml, only /subdir/test1.php is available (test1.jpg gives 404, as expected).

Is there a conventional way to server both static & php content to server out of the same directory on google app engine?

1

1 Answers

0
votes

See the accepted answer to my (sort of) similar question.

In short, you use the application_readable handler option like so:

# Serve static content
- url: /subdir/
  static_dir: subdir
  application_readable: true