首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用PHP Yii2框架的google应用程序引擎中的404错误

使用PHP Yii2框架的google应用程序引擎中的404错误
EN

Server Fault用户
提问于 2018-02-20 10:14:18
回答 1查看 1.6K关注 0票数 0

我的应用程序包含了Yii2和Php框架。

我把我的应用程序托管在google云平台的应用引擎上。

这是我的代码和app.yaml文件代码的截图。

代码语言:javascript
复制
threadsafe: true
runtime: php55
api_version: 2

handlers:

# The root URL (/) is handled by the Go application.
# No other URLs match this pattern.

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

- url: /web-service/*
  script: web-service/yii

- url: /
  static_files: index.html
  upload: index.html

我的Yii2库可以在web服务目录中使用,当我从邮递员调用rest时,它返回404页未找到错误。

我在app.yaml文件中遗漏了什么。

帮我解决这个问题。

我的Api就是这样叫的。

https://abcxyz.appspot.com/web-service/web/user-registration/login-user

EN

回答 1

Server Fault用户

发布于 2018-02-28 14:48:14

URL处理程序的顺序不正确。

盖伊把这些从上到下。你的第一个处理程序将匹配所有的东西。它永远不会到达其他两个人。

您需要更改app.yaml中的顺序:

代码语言:javascript
复制
threadsafe: true
runtime: php55
api_version: 2

handlers:

# The root URL (/) is handled by the Go application.
# No other URLs match this pattern.

- url: /
  static_files: index.html
  upload: index.html

- url: /web-service/*
  script: web-service/yii

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

建议总是最宽的底部,最严格的顶部。

App.yaml文档中的部分.请参阅.

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/897985

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档