I have deployed several PHP apps on GAE standard environment, all working fine.
Now I\'m deploying a new app, which on the local server provided by the gcloud
After several hours of testing, I finally realized what the problem was.
In GAE when declaring a certain path static, it is then interpreted as a non-code path. All files within that path are therefore not accessible by the scripts running on the PHP environment with require
or include
and they are not shown in the deployed code debugger.
For this reason, I have placed all static files in a sub-folder (www
), and non static files to be required
by PHP scripts under another subfolder.
You can use the application_readable
handler option to include the respective static files in the app code as well. From Handlers element:
application_readable
Optional. Boolean. By default, files declared in static file handlers are uploaded as static data and are only served to end users. They cannot be read by an application. If this field is set to true, the files are also uploaded as code data so your application can read them. Both uploads are charged against your code and static data storage resource quotas.
Like this:
- url: /(.*\..{2,})
static_files: \1
upload: (.*\..{2,})
application_readable: true
secure: always