2013-11-14 58 views
0

我刚刚在Google云端上放置了我的网站文件和数据库。我刚刚在Google Cloud上托管的我的网站显示为空白

当我通过website.appspot.com访问它时,它显示一个空白页面。此外,我不能访问静态资源,如website.appspot.com/images/features.png

当我查看日志,我看到的只有这些:

2013-11-14 20:41:12.107 /favicon.ico 200 61ms 0kb Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 AlexaToolbar/alxf-2.19 module=default version=1 

41.203.69.6 - - [14/Nov/2013:11:41:12 -0800] "GET /favicon.ico HTTP/1.1" 200 0 - "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 AlexaToolbar/alxf-2.19" "gcdc2013-myworkset.appspot.com" ms=61 cpu_ms=0 app_engine_release=1.8.7 


2013-11-14 20:41:11.549/404 142ms 0kb Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 AlexaToolbar/alxf-2.19 module=default version=1 

41.203.69.6 - - [14/Nov/2013:11:41:11 -0800] "GET/HTTP/1.1" 404 26 - "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 AlexaToolbar/alxf-2.19" "gcdc2013-myworkset.appspot.com" ms=142 cpu_ms=0 cpm_usd=0.000003 loading_request=1 app_engine_release=1.8.7 instance=00c61b117ceec79a7aa048437e41f62f131610 

I 2013-11-14 20:41:11.548 

This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application. 

这是我的app.yaml的内容

application: gcdc2013-myworkset 
version: 1 
runtime: php 
api_version: 1 

handlers: 
- url: /favicon\.ico 
    static_files: favicon.ico 
    upload: favicon\.ico 

- url: .* 
    script: index.php 

- url:/
    script: index.php 

- url: /index\.php 
    script: index.php 

- url: /features 
    script: features/index.php 

- url: /about 
    script: about/index.php 

- url: /oauth2callback/? 
    script: signup.php 

- url: (.*)\.[\d]{10}\.(css|js) 
    static_files: $1.$2 
    upload: (.*).(.*) 

- url: /css 
    static_dir: css 


- url: /js 
    static_dir: js 

我究竟发生了什么?

新的app.yaml

application: gcdc2013-myworkset 
version: 1 
runtime: php 
api_version: 1 

handlers: 
- url: /favicon\.ico 
    static_files: favicon.ico 
    upload: favicon\.ico 

- url: /features 
    script: features/index.php 

- url: /about 
    script: about/index.php 

- url: /css 
    static_dir: css 

- url: /images 
    static_dir: images 

- url: /js 
    static_dir: js 

- url:/
    script: index.php 

- url: /index.php 
    script: index.php 

- url: (.*).php 
    script: $1.php 

- url: /oauth2callback/? 
    script: signup.php 

#- url: (.*)\.[\d]{10}\.(css|js) 
# static_files: $1.$2 
# upload: (.*).(.*) 
+0

你确定你的ID是'website.appspot.com'吗? – jobin

回答

1

删除所有指向分开的index.php脚本条目的×1,你应该移动到app.yaml文件的底部。

正在发生的事情是,您的。*条目匹配所有请求,因此下层条目永远不会被处理。

+0

感谢您的回复,非常有帮助。请检查我的更新为新的app.yaml。在文件中明确指定的索引页面/ features /,/ about /。挑战是我如何定位其他文件,如:website.appspot.com/signup.php,website.appspot.com/plans.php,website.appspot.com/contact.php,website.appspot.com/import/a。 php,website.appspot.com/export/export.php,而不必一一列出所有文件? –

+0

首先将'script:$ 1.php'改为'script:\ 1.php' –

相关问题