简体   繁体   English

让我的 app.yaml PHP 配置在 Google App Engine 中工作

[英]Getting my app.yaml PHP configuration to work in Google App Engine

I'm completely new to Google App Engine, app.yaml has seriously stumped me and I can't figure it out, I've looked everywhere but nothing seems to work.我对 Google App Engine 完全陌生,app.yaml 严重困扰着我,我无法弄清楚,我到处寻找,但似乎没有任何效果。 This is my .yaml, everything works on XAMPP but I can't seem to get it to work/function on the App Engine.这是我的 .yaml,在 XAMPP 上一切正常,但我似乎无法让它在 App Engine 上工作/运行。

runtime: php55
api_version: 1

handlers:

- url: /(.*\.(ico$|jpg$|png$|gif$|htm$|html$|css$|js$|xml$))
  static_files: \1

  upload: (.*\.(ico$|jpg$|png$|gif$|htm$|html$|css$|js$|xml$))
  application_readable: true

- url: /(.+)
  script: \1

- url: /
  script: index.php

The includes in my index, such as <?php include "/static/include/header.php";?> does not show up on my page and that file has all my style/css includes etc as well, also how do you process the GET_[] it simply just changes the url but it doesn't get processed by the page.我的索引中的包含,例如<?php include "/static/include/header.php";?>没有显示在我的页面上,并且该文件也包含我所有的样式/css 包含等,你还好吗处理GET_[]它只是改变了 url,但它不会被页面处理。 So far I've got my logo.png to show up on my index but that's about it so far, I can't figure it out.到目前为止,我已经让我的 logo.png 显示在我的索引中,但到目前为止,我无法弄清楚。

Example: .php?ID=99999999&group=All I assume there's something I need to do to the YAML to actually make the above work.示例: .php?ID=99999999&group=All我假设我需要对 YAML 做一些事情才能使上述工作真正起作用。

This page isn't working ranked.games is currently unable to handle this request.此页面无法正常工作。排名游戏目前无法处理此请求。 HTTP ERROR 500 HTTP 错误 500

That's what I get when I have the above example suffixed.这就是我在上面的示例后缀后得到的结果。

There are some issues in your app.yaml .您的app.yaml存在一些问题。 Think of it as a regex matching process that routes requests to the proper destination.将其视为将请求路由到正确目的地的正则表达式匹配过程。 The $ goes at the end, not for each possible match. $放在最后,而不是每个可能的匹配项。

Try this:尝试这个:

# For better organization, let's put all your static files in a directory called "static", and include files in a directory called `includes`.  A .php script is not a static file

- url: /(.*\.(ico|jpg|png|gif|htm|html|css|js|xml))$
  static_files: static/\1
  upload: static/.*\.(ico|jpg|png|gif|htm|html|css|js|xml)$
  application_readable: true

If you put your include files in a directory called includes , it would look like this:如果你把你的包含文件放在一个名为includes的目录中,它看起来像这样:

- url: /includes/(.+\.php)$
  script: /includes/\1

Next, let's not send a junk URL to a script.接下来,我们不要向脚本发送垃圾 URL。 Let's make sure it matches xxx.php :让我们确保它匹配xxx.php

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM