2013-11-14 60 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' –

相關問題