谷歌应用程序引擎wordpress更新失败

时间:2014-02-05 15:20:27

标签: python wordpress google-app-engine

根据本指南,我遇到了在GAE中安装wordpress的app.yaml设置问题:https://developers.google.com/appengine/articles/wordpress

使用该指南,我复制了app.yaml(我还使用了github项目:https://github.com/GoogleCloudPlatform/appengine-php-wordpress-starter-project来检查我的复制/粘贴是否正常)。

虽然使用dev_appserver.py进行的测试工作正常,但上传时仍会显示以下消息:

03:08 PM Getting current resource limits.
03:08 PM Scanning files on local disk.
03:08 PM Scanned 500 files.
03:08 PM Scanned 1000 files.
Error 400: --- begin server output ---
Error when loading application configuration:
Unable to assign value '__static__/wordpress/.*\.(htm|html|css|js)$' to attribute 'upload':
Value '__static__/wordpress/.*\.(htm|html|css|js)$' for upload does not match expression '^(?:(?!\^).*(?!\$).)$'
--- end server output ---

我正在使用PHP SDK v1.8.9。我的app.yaml如下:

application: blah-de-blah
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

文件类型选择器正则表达式有些问题,但我不确定如何修复它。有人在这里遇到过它:Google App Engine and Wordpress set up error - Windows 7 professional但它仍未解决。

有没有人对这个问题有所了解?

2 个答案:

答案 0 :(得分:0)

好的 - 我修好了。 app.yaml需要修改。

我认为指南上的说明有点误导 - 也许某些事情已经过时了?

这是我固定的app.yaml:

application: pooper-scooper-117 
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

答案 1 :(得分:0)

您不必修改app.yaml或提交拉取请求(除非是为了更改文档)。相反,您需要获取最新版本的forngngine SDK for PHP。截至1月中旬,旧版本将无效。