Home » Php » html – Having issues with .php files and the GAE

html – Having issues with .php files and the GAE

Posted by: admin February 25, 2020 Leave a comment

Questions:

I am trying to get a contact form to work on my GAE. I have the app.yaml complete and it’s working for everything bar the .php files it shows a No web page was found for the web address when you try to go onto the webpage. The files are all in the correct directory. I originally had the form as form.php but when deploying it showed: WARNING: The URL path "/form" is reserved and will not be matched. So I changed it contact.php, but it’s still showing the same error. Would you guys have any recommendations on what I should try? The contact.php has the form in it and I also have contact_control.php to do form validation and send the email.

Thanks!

#service: default
service: test-landing
runtime: php55
api_version: 1
threadsafe: true

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

- url: /(.+\.php)$
  script: assets/
  secure: always

- url: /home
  static_files: www/index.html
  upload: www/index.html
  secure: always

- url: /news
  static_files: www/news.html
  upload: www/news.html
  secure: always

- url: /terms
  static_files: www/terms.html
  upload: www/terms/news.html
  secure: always

- url: /privacy
  static_files: www/privacy.html
  upload: www/privacy.html
  secure: always

- url: /faq
  static_files: www/faq.html
  upload: www/faq.html
  secure: always

- url: /contact
  script: /contact.php
  secure: always
- url: /contact
  static_files: /contact.php
  upload: /contact.php
  secure: always

- url: /contact_control
  script: www/contact_control.php
  secure: always

- url: /(.*)
  static_files: www/
  upload: www/(.*)
  secure: always
How to&Answers:

It seems that you will need to configure your app.yaml to recognize and use the PHP files on your Google App Engine.

I would recommend you to take a look at the following documentation on how to configure your app.yaml to work with PHP.

Besides that, there is the following documentation, on how to configure your App Engine to work correctly with PHP, that I would recommend you to take a look – they are actually quickstart documentation, which seems to be the exact place where you are. 🙂

Let me know if the information helped you!