Ogugua Belonwu
Ogugua Belonwu

Reputation: 2141

How to get my application to work on appengine

I developed a web application the usual way and hosted on a normal shared server.

These are what I mean by usual

For some reasons, I need to move the web app to appengine, I have succeeded in uploading the files but it shows me this error:

500 Server Error

with this error in my log:

Traceback (most recent call last):
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 239, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 298, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 84, in LoadObject
    obj = __import__(path[0])
ImportError: No module named index

What changes do I need to make to my files to enable my website work well on appengine without issues?

EDIT (Content of app.yaml)

application: gcdc2013-myworkset
version: 1
runtime: python27
api_version: 1
threadsafe: yes

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: .*
  script: index.php

- url: /css
  static_dir: stylesheets

- url: /images
  static_dir: images

libraries:
- name: webapp2
  version: "2.5.2"

I tried changing runtime to php but it gave an error which cleared immediately i changed it back to python27

EDIT:

Updated app.yaml file (Project deploys now but shows this error for all PHP files: Could not guess mimetype for excel/excel_reader.php. Using application/octet-stream. Also the project appears as blank when viewed on the browser):

application: gcdc2013-myworkset
version: 1
runtime: php
api_version: 1

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: .*
  script: index.php

- url: /
  script: index.php

- url: /index\.php
  script: index.php

- url: /features
  script: features/index.php

- url: /about
  script: about/index.php

- url: /oauth2callback/?
  script: signup.php  

- url: (.*)\.[\d]{10}\.(css|js)
  static_files: $1.$2
  upload: (.*).(.*)

- url: /css
  static_dir: css

- url: /js
  static_dir: js

Also, how can I import mysql database that I exported from my localhost to the appengine?

Upvotes: 0

Views: 369

Answers (1)

IanGSY
IanGSY

Reputation: 3714

Change:

runtime: python27

To:

runtime: php

And remove:

libraries:
- name: webapp2
  version: "2.5.2"

See https://developers.google.com/appengine/docs/php/config/appconfig for more information.

Upvotes: 2

Related Questions