【问题标题】:Google App Engine .yaml file working locally but not when deployedGoogle App Engine .yaml 文件在本地工作,但在部署时不工作
【发布时间】:2014-09-12 21:50:40
【问题描述】:

我的 GAE PHP .yaml 文件在本地工作,但在部署时不工作。一切正常,直到我重新组织了我的 .php 脚本所在的文件夹。应用程序的根目录中有一个 php 文件夹,.php 进一步组织到文件夹中。

当前YAML 文件:

application: raven3mil
version: 1
runtime: php
api_version: 1
threadsafe: yes

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

- url: /js
  static_dir: js

- url: /css
  static_dir: css

- url: /images
  static_dir: /static/images


# Serve php scripts.
- url: /(.+\.php)$
  script: \1

- url: /.*
  script: /login.php

error_handlers:
- file: /errors/404.html

文件结构示例:

+root
  +php
    +admin
      manageUsers.php
    +teacher
      lessons.php
    +student
      schedule.php
    dashboard.php
  +css
    index.css
    main.css
  +js
    +jquery
    +bootstrap
  login.php

我不确定为什么我的 YAML 文件在本地工作但没有部署。任何人都可以提供任何见解吗?

【问题讨论】:

  • 您在日志中看到了哪些错误/警告?

标签: php google-app-engine yaml


【解决方案1】:

如果您的脚本使用来自static_dir 的内容,您需要确保它们对应用程序可用。

您可以通过将application_readable: true 添加到您的jscssimages 处理程序来实现。

您可以在此处阅读更多信息:https://cloud.google.com/appengine/docs/php/config/appconfig

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-22
    • 1970-01-01
    • 1970-01-01
    • 2020-09-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多