Title: [Plugin: Google App Engine for WordPress] functing app.yaml
Last modified: August 21, 2016

---

# [Plugin: Google App Engine for WordPress] functing app.yaml

 *  Resolved [mobcdi](https://wordpress.org/support/users/mobcdi/)
 * (@mobcdi)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-app-engine-for-wordpress-functing-appyaml/)
 * I know its not directly related to this plugin but it is an issue that affects
   wordpress users trying to deploy to GAE
    I was hoping someone has a working app.
   yaml for the latest version of GAE php as the developer version here [https://developers.google.com/appengine/articles/wordpress](https://developers.google.com/appengine/articles/wordpress)
   and the github version here [https://github.com/GoogleCloudPlatform/appengine-php-wordpress-starter-project/blob/master/app.yaml](https://github.com/GoogleCloudPlatform/appengine-php-wordpress-starter-project/blob/master/app.yaml)
   don’t work with the version of GAE at the moment.
 * If you use the handler values defined at the time of writing you get an error
   when you use appcfg.py to update your code on GAE
 * 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 ‘^(?:(?!\^).*(?!\$).)$’
 * [https://wordpress.org/plugins/google-app-engine/](https://wordpress.org/plugins/google-app-engine/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [isnapp](https://wordpress.org/support/users/isnapp/)
 * (@isnapp)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-app-engine-for-wordpress-functing-appyaml/#post-4578796)
 * Removing the $ at the end of the upload line(s) should make it work.
 * So for example change:
 *     ```
       upload: wordpress/.*\.(htm|html|css|js)$
       ```
   
 * to
 *     ```
       upload: wordpress/.*\.(htm|html|css|js)
       ```
   
 *  Thread Starter [mobcdi](https://wordpress.org/support/users/mobcdi/)
 * (@mobcdi)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-app-engine-for-wordpress-functing-appyaml/#post-4578798)
 * Thanks I tried that. I also had to modify the handlers as I want wordpress to
   run in the webroot not a /wordpress/ subfolder.
 * I’ve gotten the app to upload but still not sure I have all the handlers correct.
   Would you mind sharing your handler definitions from a working app.yaml?
 *  [isnapp](https://wordpress.org/support/users/isnapp/)
 * (@isnapp)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-app-engine-for-wordpress-functing-appyaml/#post-4578800)
 * If by running from the webroot you mean that you don’t see an extra /wordpress/
   in the url on your browser then you can use the yaml below:
 *     ```
       application: your-application-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
       ```
   
 * This is exactly the app.yaml from [https://developers.google.com/appengine/articles/wordpress](https://developers.google.com/appengine/articles/wordpress)
   
   but with the trailing $ removed from (just) the upload lines.
 * For me this works as a charm.
 *  Thread Starter [mobcdi](https://wordpress.org/support/users/mobcdi/)
 * (@mobcdi)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-app-engine-for-wordpress-functing-appyaml/#post-4578801)
 * If I use those handlers, I get a blank page on appspot.com & 404 errors in the
   app logs
 *     ```
       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
       ```
   
 *  Thread Starter [mobcdi](https://wordpress.org/support/users/mobcdi/)
 * (@mobcdi)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-app-engine-for-wordpress-functing-appyaml/#post-4578803)
 * On the other hand if I use these handlers I get the
    **Error establishing a database
   connection**
 *     ```
       handlers:
       - url: /(.*\.(htm|html|css|js))$
         static_files: wordpress/\1
         upload: /.*\.(htm|html|css|js)
         application_readable: true
   
       - url: /wp-content/(.*\.(ico|jpg|png|gif))$
         static_files: /wp-content/\1
         upload: /wp-content/.*\.(ico|jpg|png|gif)
         application_readable: true
   
       - url: /(.*\.(ico|jpg|png|gif))$
         static_files: /\1
         upload: /.*\.(ico|jpg|png|gif)
   
       - url: /wp-admin/(.+)
         script: /wp-admin/\1
         secure: always
   
       - url: /wp-admin/
         script: /wp-admin/index.php
         secure: always
   
       - url: /wp-login.php
         script: /wp-login.php
         secure: always
   
       - url: /wp-cron.php
         script: wp-cron.php
         login: admin
   
       - url: /xmlrpc.php
         script: xmlrpc.php
   
       - url: /wp-(.+).php
         script: wp-\1.php
   
       - url: /(.+)?/?
         script: index.php
       ```
   
 *  [isnapp](https://wordpress.org/support/users/isnapp/)
 * (@isnapp)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-app-engine-for-wordpress-functing-appyaml/#post-4578806)
 * I suspect that you don’t have wordpress in a subfolder wordpress inside your 
   app folder.
    Because of that wordpress could have an issue finding the wp-config.
   php
 *  Thread Starter [mobcdi](https://wordpress.org/support/users/mobcdi/)
 * (@mobcdi)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-app-engine-for-wordpress-functing-appyaml/#post-4578807)
 * Correct, I’m trying to get WordPress to run my projects appspot.com root directory.
 * Did you have to make a changes to the wp-config to get it to find your database
   besides supplying the dbname, user & password values?
 *  [isnapp](https://wordpress.org/support/users/isnapp/)
 * (@isnapp)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-app-engine-for-wordpress-functing-appyaml/#post-4578809)
 * You also need to set the correct host
 *     ```
       define('DB_HOST', ':/cloudsql/your-app-id:sql');
       ```
   
 * Replace the your-app-id:sql with your own app-id and Cloud SQL instance name.
 *  Thread Starter [mobcdi](https://wordpress.org/support/users/mobcdi/)
 * (@mobcdi)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-app-engine-for-wordpress-functing-appyaml/#post-4578818)
 * I’ve done that but with debug set to true the connection still fails for ‘user’@’localhost’
   in wp-db.php line 1147
 * I copied the instance ID from the cloud sql summary page and the value
    :/cloudsql/
   Project:Instance is displaying on the error page
 * I’m also able to connect to the db using the wordpress username & password using
   MySQL Workbench and have tried re-creating the database, user and password
 *  Plugin Author [slangley](https://wordpress.org/support/users/slangley/)
 * (@slangley)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/plugin-google-app-engine-for-wordpress-functing-appyaml/#post-4579004)
 * You’re better off asking this question on stackoverflow using the tags [google-
   app-engine] and [php].
 * Resolving as this is not a plugin issue.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘[Plugin: Google App Engine for WordPress] functing app.yaml’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/google-app-engine_e8c9ab.svg)
 * [Google App Engine for WordPress](https://wordpress.org/plugins/google-app-engine/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-app-engine/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-app-engine/)
 * [Active Topics](https://wordpress.org/support/plugin/google-app-engine/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-app-engine/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-app-engine/reviews/)

## Tags

 * [gae](https://wordpress.org/support/topic-tag/gae/)

 * 10 replies
 * 3 participants
 * Last reply from: [slangley](https://wordpress.org/support/users/slangley/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/plugin-google-app-engine-for-wordpress-functing-appyaml/#post-4579004)
 * Status: resolved