问题描述
我想使用GAE运行简单的html网站。请帮助我为我的应用程序编写正确的yaml配置文件。当我尝试部署此应用程序时,它会给出一个错误。但是,如果我没有新的处理程序部署应用程序,没有被app.yaml自动填充,它的工作原理是
文件结构是
$ p code $ c
images
js
index.html
..
和yaml文件是:
应用程序:shimlachadwick
版本:1
运行时:php
api_version:1
threadsafe:是
处理程序:
- url:/favicon\.ico
static_files:favicon.ico $ b $上传:favicon\.ico
- url:/ images
static_dir:images
- url:/ js
static_dir:js
- url:/ css
static_dir:css
- url:。*
script:index.html
典型的app.yaml只是静态的帐篷会像这样安排:将静态内容放在一个子目录中,比如说htdocs。然后在底部添加一个处理程序作为您的全部捕获:
- url:/
static_dir:htdocs
总之,我期望以下app.yaml:
应用程序:shimlachadwick
版本:1
运行时:php
api_version:1
处理程序:
- url:/
static_dir:htdocs
假设您想要根路径/映射到生成动态内容的index.php文件(并且不能位于htdocs中)。然后,这是一个添加映射到该index.php文件的早期条目的问题:
application:shimlachadwick
version :1
运行时:php
api_version:1
处理程序:
- url:/ $
脚本:index.php
- url:/
static_dir:htdocs
i want to run simple html website using GAE.Please help me in writing the correct yaml configuration file for my application.When I tried to deploy this application it gives an error.However if i deploy app without new handlers i.e those are not populated by app.yaml automatically it worksFile structure is as
css
images
js
index.html
..
and yaml file is as :
application: shimlachadwick
version: 1
runtime: php
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /images
static_dir: images
- url: /js
static_dir: js
- url: /css
static_dir: css
- url: .*
script: index.html
A typical app.yaml that just does static content would be arranged like this: put the static content in a subdirectory, say "htdocs". Then have a handler at the bottom as your "catch-all":
- url: /
static_dir: htdocs
So altogether, I'd expect the following app.yaml:
application: shimlachadwick
version: 1
runtime: php
api_version: 1
handlers:
- url: /
static_dir: htdocs
Let's say that you wanted the root path "/" to map to a index.php file that generates dynamic content (and must not be inside htdocs). Then that's a matter of adding an earlier entry that maps to that index.php file:
application: shimlachadwick
version: 1
runtime: php
api_version: 1
handlers:
- url: /$
script: index.php
- url: /
static_dir: htdocs
这篇关于yaml php运行时环境配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!