为什么我的php页面在谷歌应用引擎中下载


Why is my php page downloading in google app engine?

请帮忙解决问题!我的PHP脚本没有执行,它下载在Google AppEngine中。如何解决这个问题?

app.yaml:

application: web-sites-testing    
version: 1    
runtime: php    
api_version: 1    
threadsafe: yes
handlers:    
- url: /(.+'.php)$
  script: '1    
- url: /main.php
  script: main.php

你能在你的app.yaml中更改url处理程序的顺序吗.据我说,它应该是这样的:

处理器:
-网址:/main.php 脚本:主脚本.php

-网址:/(.+.php)$ 脚本:''1

它应该根据我的理解工作。和以前一样,/main.php URL 传递正则表达式 (/(.+.php)$) 处理程序,因此它会尝试运行脚本 ''1(因为没有定义脚本)。更改顺序时,主.php URL 处理程序排在第一位,因此它将由主.php脚本处理。

我将其添加为第一个处理程序:

- url: /(.+'.php)$
  script: '1

所以现在我的app.yaml看起来像这样:

runtime: php55
api_version: 1
threadsafe: true
handlers:
- url: /(.+'.php)$
  script: '1    
- url: /
  static_files: www/index.html
  upload: www/index.html
- url: /(.*)
  static_files: www/'1
  upload: www/(.*)

和 php 文件按预期执行