【问题标题】:yaml configuration file for php runtime enviornmentphp运行环境的yaml配置文件
【发布时间】:2014-09-17 16:30:28
【问题描述】:

我想使用 GAE 运行简单的 html 网站。请帮助我为我的应用程序编写正确的 yaml 配置文件。当我尝试部署此应用程序时,它会出现错误。但是,如果我在没有新处理程序的情况下部署应用程序,即那些是不是由 app.yaml 自动填充的,它可以工作 文件结构如下

css
images
js
index.html
..

yaml 文件如下:

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

【问题讨论】:

  • 嗨罗希特。你的确切问题是什么?你试过什么? SO 不是为您编写代码,而是为您提供有关如何解决问题的建议。您遇到了什么问题?
  • 另外,如果您说“有错误”,复制并粘贴准确错误文本会很有帮助。错误消息很有用:它们通常包含不止一个信息。

标签: php google-app-engine yaml


【解决方案1】:

一个只处理静态内容的典型 app.yaml 会这样安排:将静态内容放在一个子目录中,比如“htdocs”。然后在底部有一个处理程序作为您的“包罗万象”:

- url: /
  static_dir: htdocs

总的来说,我希望有以下 app.yaml:

application: shimlachadwick
version: 1
runtime: php
api_version: 1

handlers:
- url: /
  static_dir: htdocs

假设您希望根路径“/”映射到生成动态内容的 index.php 文件(并且不能在 htdocs 中)。然后添加一个映射到该 index.php 文件的较早条目:

application: shimlachadwick
version: 1
runtime: php
api_version: 1

handlers:

- url: /$
  script: index.php

- url: /
  static_dir: htdocs

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-11-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-17
    • 2017-01-26
    • 2021-07-14
    • 1970-01-01
    相关资源
    最近更新 更多