Cool Coder
Cool Coder

Reputation: 309

Goole App Engine - Deployed PHP app does not recognize php files

I have deployed my web app - a php app in google app engine. App.yaml code

runtime: php55
api_version: 1
#threadsafe: true

handlers:
- url: /
  static_files: www/index.html
  upload: www/index.html

- url: /mail
  static_dir: www/mail
# Serve php scripts.
- url: /mail/.*
  script: www/mail/mailsender_1.php
- url: /(.*)$
  static_files: www/\1
  upload: www/(.*)

However, when /mail/mailsender_1.php is called from javascript - ajax call, it does not recognize mailsender_1.php as php script. I have spent a complete day on debugging. Any help would be appreciated.

Upvotes: 1

Views: 82

Answers (1)

Rafael Lemos
Rafael Lemos

Reputation: 5819

By looking at your issue and comparing with this community question, it occured to me that the issue you are facing is due the /(.*)$ handler, not the /mail/.* one.

The accepted answer on that post suggest that your /(.*)$ handler is making the deploy think that all files in your www/ directory are static and uploadable, including .php scripts.

My suggestion would be to change the upload: www/(.*) directive to upload: www/(.*)\.(js|css|png|jpg|jpeg|map|woff) as it will suit all file extention you have, according to the comments.

So your handler section should look like this:

handlers:
- url: /
  static_files: www/index.html
  upload: www/index.html

- url: /mail
  static_dir: www/mail
# Serve php scripts.
- url: /mail/.*
  script: www/mail/mailsender_1.php
- url: /(.*)$
  static_files: www/\1
  upload: www/(.*)\.(js|css|png|jpg|jpeg|map|woff)

Upvotes: 1

Related Questions