Can I run PHP files on Google App Engine for Python?

jpdstan

As a disclaimer, I'm new to app development.

So I've been working on this website using Google App Engine with the Python Runtime Environment. Problems arose when I was creating a simple form in HTML and decided to use PHP to store the data. Am I allowed to use PHP scripts when my application is being run in Python?

I also noticed that GAE now has a PHP runtime environment, so should I use that instead? I only used Python because it was easy to use at first and I didn't think I needed PHP.

This is what my main.py looks like, if it matters:

import os
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.ext.webapp import template

class MainHandler(webapp.RequestHandler):
  def get (self, q):
    if q is None:
      q = 'index.html'

    path = os.path.join (os.path.dirname (__file__), q)
    self.response.headers ['Content-Type'] = 'text/html'
    self.response.out.write (template.render (path, {}))

def main ():
  application = webapp.WSGIApplication ([('/(.*html)?', MainHandler)], debug=True)
  util.run_wsgi_app (application)

if __name__ == '__main__':
  main ()
Dan Sanderson

No, you will not be able to run PHP scripts in the Python runtime environment. If your application is more easily written in PHP, you can use the PHP runtime environment.

In app.yaml, set runtime: php, and create handlers: where the script: value is a PHP script:

applciation: helloworld
version: 1
runtime: php
api_version: 1

handlers:
- url: /.*
  script: helloworld.php

Then helloworld.php can be a PHP script, such as:

<?php
  echo 'Hello, world!';
?>

Note that you can use the same SDK for both Python and PHP.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Can I run PHP files on Google App Engine for Python?

From Dev

How can I run app tests that use Google App Engine PHP SDK functions from the command line

From Dev

Can't run coursebuilder in google app engine

From Dev

Can i use HikariCP on Google App Engine

From Dev

Can i use HikariCP on Google App Engine

From Dev

Upload Files To Google Cloud Storage With Google App Engine (Python)

From Dev

How do I run Selenium tests with Google App Engine?

From Dev

php google app engine uploading files on local dev server

From Dev

php google app engine uploading files on local dev server

From Dev

Best solution / practice for temp files with Google App Engine PHP?

From Dev

putting the files in different folders with google app engine... python

From Dev

Can I use TensorFlow in a Google App Engine module?

From Dev

Can I use Goroutines in Google App Engine (Standard Environment)?

From Dev

How can I modify my authentication and authorization on google app engine?

From Dev

Why can't I send Email on Google app engine?

From Dev

Can I point a domain at a google app engine service?

From Dev

Can I instance 2 memcache classes on Google App Engine?

From Dev

Google Cloud App Engine Cron can't execute python script

From Dev

Google App Engine Cron PHP

From Dev

Making an application with Python and PHP and HTML on Google's app Engine

From Dev

Google App Engine php, app.yaml - matching files without extension

From Dev

google app engine app.yaml for php static files don't load

From Dev

Run Alembic migrations on Google App Engine

From Dev

How to run selenium in google app engine/cloud?

From Dev

Not able to run nodejs project on google app engine

From Dev

Python deploy to Google App Engine

From Dev

OAuth for Google App Engine Python

From Dev

python Google App engine deployment

From Dev

Python deploy to Google App Engine

Related Related

  1. 1

    Can I run PHP files on Google App Engine for Python?

  2. 2

    How can I run app tests that use Google App Engine PHP SDK functions from the command line

  3. 3

    Can't run coursebuilder in google app engine

  4. 4

    Can i use HikariCP on Google App Engine

  5. 5

    Can i use HikariCP on Google App Engine

  6. 6

    Upload Files To Google Cloud Storage With Google App Engine (Python)

  7. 7

    How do I run Selenium tests with Google App Engine?

  8. 8

    php google app engine uploading files on local dev server

  9. 9

    php google app engine uploading files on local dev server

  10. 10

    Best solution / practice for temp files with Google App Engine PHP?

  11. 11

    putting the files in different folders with google app engine... python

  12. 12

    Can I use TensorFlow in a Google App Engine module?

  13. 13

    Can I use Goroutines in Google App Engine (Standard Environment)?

  14. 14

    How can I modify my authentication and authorization on google app engine?

  15. 15

    Why can't I send Email on Google app engine?

  16. 16

    Can I point a domain at a google app engine service?

  17. 17

    Can I instance 2 memcache classes on Google App Engine?

  18. 18

    Google Cloud App Engine Cron can't execute python script

  19. 19

    Google App Engine Cron PHP

  20. 20

    Making an application with Python and PHP and HTML on Google's app Engine

  21. 21

    Google App Engine php, app.yaml - matching files without extension

  22. 22

    google app engine app.yaml for php static files don't load

  23. 23

    Run Alembic migrations on Google App Engine

  24. 24

    How to run selenium in google app engine/cloud?

  25. 25

    Not able to run nodejs project on google app engine

  26. 26

    Python deploy to Google App Engine

  27. 27

    OAuth for Google App Engine Python

  28. 28

    python Google App engine deployment

  29. 29

    Python deploy to Google App Engine

HotTag

Archive