Google App Engine中的URL处理程序PHP灵活的环境

时间:2018-03-05 09:55:39

标签: php google-app-engine app.yaml

我已经在Google App Engine中部署了一个PHP项目作为灵活环境,我想要的是拥有一个自定义URL,以便用户可以按

www.example.com/user

必须指向

www.example.com/core/userProfile/user.php

我已将app.yaml更改为此,但我无法让它工作

runtime: php
env: flex
service: api 
api_version: 1
threadsafe: true

resources:
  cpu: 1
  memory_gb: 1
  disk_size_gb: 10

# Starting Point
runtime_config:
  document_root: '.'

# Routers
handlers:
- url: /test.php
  script: /test.php

- url: /index.php
  script: index.php

- url: /user
  script: core/userProfile/user.php

任何网址都会给出以下结果

Error: Not Found
The requested URL /user was not found on this server.

1 个答案:

答案 0 :(得分:0)

您的app.yaml配置正在将标准环境Handlers element混合到flexible environment configuration中,因此可能会被忽略。以某种方式相关:How to tell if a Google App Engine documentation page applies to the standard or the flexible environment

您需要处理Flex应用程序中内部的URL路由,请参阅Quickstart for PHP in the App Engine Flexible Environment