riverrunner
riverrunner

Reputation: 115

Google App Engine - Separate Project Required?

I'm trying to port a simple website across to the Google App Engine. My website uses PHP and accesses a MySQL database.

In the App engine I've created a project, e.g.: my-project.

Then within that project I did what I was told, to get a MySQL database up and running: create a SQL instance, download phpMyAdmin locally, create app.yaml file:

application: my-project
version: 1
module: default
runtime: php55
api_version: 1

handlers:

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

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

- url: /(.*\.(php$))
  script: \1
  login: admin

- url: /(.+)
  script: index.php
  login: admin

- url: /.*
  script: index.php
  login: admin

I then deployed the app and went to https://phpmyadmin-dot-my-project.appspot.com

phpMyAdmin worked perfectly.

Next, I created followed the helloworld.php example: https://cloud.google.com/appengine/docs/php/gettingstarted/helloworld

Again, that worked, with the PHP code executing on the server to display 'Hello world!'.

Finally, I went back to: https://phpmyadmin-dot-my-project.appspot.com but no dice, it just displays 'Hello world!'.

Must be something very basic that I'm missing, do I need to create a separate project for each?

E.g.: 1. create project with MySQL DB instance and phpMyAdmin 2. create project with the PHP files

Upvotes: 1

Views: 85

Answers (1)

riverrunner
riverrunner

Reputation: 115

In the app.yaml for phpmyadmin, I needed to change: module: default to module: phpmyadmin

application: myapp-beta version: 1 module: phpmyadmin runtime: php55 api_version: 1

Same for the app.yaml file for helloworld. Just created a new module called helloworld.

Need to read up on YAML and modules... thanks!

Upvotes: 1

Related Questions