Php Google应用程序引擎-找不到调度配置

Php Google应用程序引擎-找不到调度配置,php,google-app-engine,Php,Google App Engine,我想为GAE(php运行时)创建非常标准的设置:2个具有特定URL(路由)的模块: RESTAPI的模块api web基础应用程序的模块应用程序 我已经创建了4.yaml配置文件: 应用程序yaml application: ABC version: 1 runtime: php55 api_version: 1 threadsafe: yes automatic_scaling: max_idle_instances: 20 handlers: - url: /.* scrip

我想为GAE(php运行时)创建非常标准的设置:2个具有特定URL(路由)的模块:

  • RESTAPI的模块api
  • web基础应用程序的模块应用程序
我已经创建了4.yaml配置文件:
应用程序yaml

application: ABC
version: 1
runtime: php55
api_version: 1
threadsafe: yes

automatic_scaling:
  max_idle_instances: 20

handlers:
- url: /.*
  script: api/web/index.php
application: ABC

dispatch:
- url: "*/app/*"
  module: web-based

- url: "*/*"
  module: default
application: ABC
module: web-based
version: 1
runtime: php55
api_version: 1
threadsafe: yes

automatic_scaling:
  min_idle_instances: 2
  max_pending_latency: 1s

handlers:
- url: /(.*\.(gif|png|jpg|css|js|otf))
  static_files: /\1
  upload: /(.*\.(gif|png|jpg|js|css|otf))
调度。yaml

application: ABC
version: 1
runtime: php55
api_version: 1
threadsafe: yes

automatic_scaling:
  max_idle_instances: 20

handlers:
- url: /.*
  script: api/web/index.php
application: ABC

dispatch:
- url: "*/app/*"
  module: web-based

- url: "*/*"
  module: default
application: ABC
module: web-based
version: 1
runtime: php55
api_version: 1
threadsafe: yes

automatic_scaling:
  min_idle_instances: 2
  max_pending_latency: 1s

handlers:
- url: /(.*\.(gif|png|jpg|css|js|otf))
  static_files: /\1
  upload: /(.*\.(gif|png|jpg|js|css|otf))
基于web的.yaml

application: ABC
version: 1
runtime: php55
api_version: 1
threadsafe: yes

automatic_scaling:
  max_idle_instances: 20

handlers:
- url: /.*
  script: api/web/index.php
application: ABC

dispatch:
- url: "*/app/*"
  module: web-based

- url: "*/*"
  module: default
application: ABC
module: web-based
version: 1
runtime: php55
api_version: 1
threadsafe: yes

automatic_scaling:
  min_idle_instances: 2
  max_pending_latency: 1s

handlers:
- url: /(.*\.(gif|png|jpg|css|js|otf))
  static_files: /\1
  upload: /(.*\.(gif|png|jpg|js|css|otf))
api.yaml

application: ABC
module: default
version: 1
runtime: php55
api_version: 1
threadsafe: yes

manual_scaling:
  instances: 1

handlers:
- url: /(.*\.(gif|png|jpg|css|js|otf))
  static_files: web/\1
  upload: web/(.*\.(gif|png|jpg|js|css|otf))

- url: /assets/(.+)
  static_files: web/assets/\1
  upload: web/assets/(.+)

- url: /.*
  script: web/index.php  
目录结构:

- api/api.yaml
- app/web_base.yaml
- app.yaml
- dispatch

当我尝试更新调度时,我得到的调度配置文件找不到。有人能帮我吗?

在多模块应用程序中,没有应用程序级别
app.yaml
了,每个模块只有一个
.yaml
文件,就是这样

因此,去掉顶级的
app.yaml
(如果需要,将其相关内容合并到
api.yaml
文件中,该文件是您的
默认
模块的文件)。这两个文件发生冲突,可能会混淆update\u分派操作。然后部署默认模块-通常需要在应用程序级别配置(如
dispatch.yaml
文件)之前部署该模块,然后才能部署其他模块

也许可以看看,它是针对python应用程序的,但其中的许多内容,如应用程序目录结构、应用程序级别配置(例如调度)和部署,也适用于php

旁注:

  • 您还缺少基于web的.yaml
    中的动态处理程序
  • 对于
    default
    模块,您不需要调度规则,也就是说,没有路由的请求无论如何都会被调度到该模块
  • 就我个人而言,我会将web应用程序设置为默认模块,而将其余模块设置为非默认模块-我不希望所有垃圾在默认情况下进入REST模块

谢谢您的回复。我已从根文件夹中删除app.yaml并更新了这两个模块。还是会犯那个错误。有什么想法吗?哪一个是您使用的确切cmd和哪个dir?顺便说一句,您的文件实际上被称为
dispatch.yaml
,而不是您在目录结构中提到的
dispatch
,对吗?是的,它是dispatch.yaml。我使用了appcfg.py更新api/api.yaml app/web_base.yaml。然后尝试运行appcfg.py-一个项目名称更新调度api。没关系。看来我在发送命令时输入了错误的目录。成功了。