Static File Referenced By Handler Not Found

The error static file referenced by handler not found is usually caused by an error in an application’s app.yaml. Basically, it means that one of the static file handlers in app.yaml is redirecting to a file that doesn’t exist or is named incorrectly.

Here’s a simple example. Suppose an application maps favicon.ico in this manner:

- url: /favicon.ico
  static_files: static/favicon.ico
  upload: static/favicon.ico

This handler statement says that the application has a folder named static, which holds a file named favicon.ico. But it maps the file so it looks like it’s located at the root of the application: example-id . appspot . com / favicon.ico. Now if the folder static doesn’t exist, or the file is missing, then attempting to access the file via the web will cause this error. Here’s how it looks in App Engine logs:

To fix, review the handlers section of app.yaml and make sure that the referenced files exist within the application folder.

app.yaml In PHP

I’ve been poking around the PHP runtime and building a few demonstration applications. One of the major difficulties with configuring a PHP app is getting the app.yaml file to work properly.

Here’s a demonstration app,yaml file to get a basic app going:

application: [app-id]
version: 1
runtime: php
api_version: 1
threadsafe: true
handlers:
- url: /static
  static_dir: static
  expiration: 30d
- url: /favicon.ico
  static_files: static/favicon.ico
  upload: static/favicon.ico
- url: .*
  script: yourphpfile.php