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
(@mobcdi)
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?
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
but with the trailing $ removed from (just) the upload lines.
For me this works as a charm.
Thread Starter
mobcdi
(@mobcdi)
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
(@mobcdi)
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
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
(@mobcdi)
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?
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
(@mobcdi)
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
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.