google 云平台 app.yaml for codeigniter php73

google cloud platform app.yaml for codeigniter php73

我不知道如何使用 php 7.3 gcp 为 codeigniter 3 设置 app.yaml。每个有用的 link 大约是 php55.. 在此先感谢。

runtime: php73 # Replace with php73 to use the PHP 7.3 runtime

handlers:
# Serve a directory as a static resource.
- url: /stylesheets
  static_dir: stylesheets


# Serve images as static resources.
- url: /(.+\.(gif|png|jpg))$
  static_files: 
  upload: .+\.(gif|png|jpg)$

# Serve your app through a front controller at index.php or public/index.php.
- url: .*
  script: auto

这是我从 gcp 文档中得到的。它有效,但 css 和 js 不工作。一切都在资产文件夹中。

您没有匹配 css 和 js 文件的处理程序规则,它们只会匹配 - url: .* 规则,这是不合适的(script 处理程序被设计仅适用于 php 个脚本)。

您需要为它们添加规则,在 - url: .* 规则之上,可能遵循以下原则(根据您应用的特定需求进行调整):

# Serve css and js files as static resources.
- url: /(.+\.(css|js))$
  static_files: assets/
  upload: assets/.+\.(css|js)$