google app engine wordpress update failure

I have come across a problem with the app.yaml setup for the installation of wordpress in GAE following this guide: https://developers.google.com/appengine/articles/wordpress

Using the guide, I copied the app.yaml (I also used the github project: https://github.com/GoogleCloudPlatform/appengine-php-wordpress-starter-project to check that my copy/paste was ok).

Read More

Whilst the test using dev_appserver.py works fine, the upload whinges with the message:

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 ---

I am using the PHP SDK v1.8.9. My app.yaml is as follows:

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

Something is up with the file type selector regex, but I’m not sure how to fix it. Someone came across it here: Google App Engine and WordPress set up error – Windows 7 professional but it’s still not fixed.

Does anyone have any light to shed on the subject?

Related posts

Leave a Reply

2 comments

  1. Ok – I fixed it. The app.yaml needed modifying.

    I think the instructions on the guide are a bit misleading – maybe something is out of date?

    Here is my fixed 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
    
  2. you shouldn’t have to modify the app.yaml or submit a pull request(unless it’s to change the documentation). Instead you need to get the latest version of the appengine SDK for PHP. As of mid January older versions won’t work.