【发布时间】:2013-11-14 23:10:00
【问题描述】:
我以通常的方式开发了一个 Web 应用程序并托管在一个普通的共享服务器上。
这就是我所说的通常的意思
- 包含我的 PHP 函数文件(使用 php include/require)
- 将我的普通 MySQL 数据库与 msqli 一起使用
- 使用 FTP 将我的文件正常上传到服务器。
由于某些原因,我需要将网络应用程序移至 appengine,我已成功上传文件,但它显示此错误:
500 Server Error
我的日志中有这个错误:
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
我需要对文件进行哪些更改才能使我的网站在 appengine 上正常运行而不会出现问题?
编辑(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"
我尝试将运行时更改为 php,但它给出了一个错误,立即清除了我将其更改回 python27
编辑:
更新了app.yaml 文件(项目现在部署,但所有 PHP 文件都显示此错误:Could not guess mimetype for excel/excel_reader.php. Using application/octet-stream.
在浏览器上查看时,该项目也显示为空白):
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
另外,如何将我从本地主机导出的 mysql 数据库导入到 appengine?
【问题讨论】:
-
看起来您的应用程序配置为 python 运行时,而不是 php。你能发布你的 app.yaml 文件的内容吗?
-
@IanGSY 请检查我的帖子,我编辑并添加了我的 app.yaml 的内容
标签: php mysql google-app-engine