404 on live Google App Engine, while working on local SDK server

前端 未结 2 362
一向
一向 2021-01-28 19:19

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

相关标签:
2条回答
  • 2021-01-28 19:28

    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.

    0 讨论(0)
  • 2021-01-28 19:50

    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
    
    0 讨论(0)
提交回复
热议问题