appspot的app.yaml文件设置问题

时间:2019-11-22 11:38:57

标签: php google-app-engine yaml

我有示例app.yaml,但在完成部署后尝试查看链接时遇到此错误:

This xxxxxxx.appspot.com page can’t be found
No webpage was found for the web address: 
http://xxxxx.appspot.com/index.php


APP.YAML设置:

runtime: php55
api_version: 1

handlers:
# Serve images as static resources.
- url: /(.+\.(gif|png|jpg))$
  static_files: 
  upload: .+\.(gif|png|jpg)$
  application_readable: true

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


该目录中的文件为:

app.yaml
index.php
post.php
pic.PNG

1 个答案:

答案 0 :(得分:1)

您可以看到相关问题here

  

在GAE中,当声明某个静态路径时,会将其解释为非代码路径。因此,在PHP环境中运行带有require或include的脚本无法访问该路径中的所有文件。

尝试将所有静态文件放在www.子文件夹下,而将非静态文件放在另一个子文件夹下。只是尝试将它们分开。