安装过程中Word App在Google App Engine上出错

时间:2013-10-07 20:43:12

标签: php wordpress google-app-engine yaml

我正在尝试首次在Google App Engine上设置WordPress。我正在关注Google's tutorial,当我使用cmd:

在本地启动开发服务器时
C:\Program Files\Google\google_appengine>dev_appserver.py C:\Development\myApp

我收到了以下错误:

google.appengine.api.yaml_errors.EventError: Unknown url handler type.
<URLMap
    auth_fail_action=redirect
    static_dir=None
    secure=default
    http_headers=None
    url=/wp-(.+).php
    static_files=None
    expiration=None
    upload=None
    api_endpoint=None
    script=None
    application_readable=None
    position=None
    login=optional
    mime_type=None
    require_matching_file=None
    >
  in "C:\Development\myApp\app.yaml", line 41, column 2

'app.yaml'在教程中复制,但使用正确的app i.d.加入:

application: myApp ID
version: wp
runtime: php
api_version: 1

handlers:
- url: /(.*\.(htm$|html$|css$|js$))
  static_files: wordpress/\1
  upload: wordpress/(.*\.(htm$|html$|css$|js$))
  application_readable: true

- url: /wp-content/(.*\.(ico$|jpg$|png$|gif$))
  static_files: wordpress/wp-content/\1
  upload: wordpress/wp-content/(.*\.(ico$|jpg$|png$|gif$))
  application_readable: true

- url: /(.*\.(ico$|jpg$|png$|gif$))
  static_files: wordpress/\1
  upload: wordpress/(.*\.(ico$|jpg$|png$|gif$))

- url: /wp-admin/(.+)
  script: wordpress/wp-admin/\1
  secure: always

- url: /wp-admin/
  script: wordpress/wp-admin/index.php
  secure: always

- url: /wp-login.php
  script: wordpress/wp-login.php
  secure: always

- url: /wp-cron.php
  script: wordpress/wp-cron.php
  login: admin

- url: /xmlrpc.php
  script: wordpress/xmlrpc.php

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

- url: /(.+)?/?
  script: wordpress/index.php

这是引发错误的行:

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

所以,我不知道该怎么做 - 任何想法都会非常感激。

日Thnx!

2 个答案:

答案 0 :(得分:4)

您需要修复yaml标记,在提供问题的行之前只有1个空格,请在“脚本”一词前检查:

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

第二行应该有2个空格,如下所示:

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

我今天也遇到了这个错误,很容易错过。

答案 1 :(得分:0)

我在另一个Q上找到了SO有一个不同的问题,但发现他们的app.yaml缺少这条线,所以我删除了它并尝试了一下:它工作了!