-1

I've launched an HTML site that works just fine on GAE but I am struggling when it comes to activating and integrating my PHP code. I know it is likely because of my app.yaml contruction. I followed other recommendations to simplify the app.yaml file at first. I researched others who fully list off all the scripts and files needed within the app.yaml and tried this approach with no luck.

Here is my current app.yaml:

application: safe
version: 1
runtime: php
api_version: 1
threadsafe: true

handlers:
- url: /
  static_files: static/index.html
  upload: static/index.html
- url: /
  static_dir: static/

My directory of files looks like this:

http://i.imgur.com/9VO92oB.jpg

The index.html resides within the static dir and within it, there is a contact form that calls a PHP file within the contact-form directory.

Is there a simple way to fix the app.yaml? Can I add only the PHP file as a script directive within the app.yaml without listing everything? Is there anything else I need to do to get the PHP code to work?

Thanks, Chris

harozi2
  • 9
  • 2

1 Answers1

0

You shouldn't need both handlers as they overlap since the first handles just index.html and second handles everything in static/ which includes index.html.

Also note that everything does not have to be placed in a directory named static. If you choose to keep that it may still make sense to move PHP outside of that since it is not static, but ignoring that the following will serve any php files in contact-form from the URL path /contact-form/...

- url: /contact-form/(.+\.php)
  script: static/contact-form/\1

You could also do something that works for all php files like.

- url: /(.+\.php)
  script: static/\1

Or if you move out of static directory:

- url: /(.+\.php)
  script: \1
boombatower
  • 651
  • 4
  • 6
  • Thanks for responding! I tried removing one of the existing handlers and both times the site rendered improperly. I also added your second recommendation but it is still giving me An Unexpected Error Has Occurred message when I call the PHP file. The current PHP file that is being called only has a hello world statement in it. – harozi2 Dec 10 '13 at 20:09
  • Do you have any other ideas that I could try? Is there anything I need to do in order to activate PHP on the actual server? Or does the runtime:php handle that? – harozi2 Dec 13 '13 at 23:49
  • 1
    If you are receiving "An Unexpected Error Has Occurred" you should check the logs in the app console and see if any additional information. Alternatively do you have a link to app and so I might be able to see this directly? – boombatower Dec 16 '13 at 20:48