启动Google App Engine Web服务器 [英] Starting Google App Engine Web Server

查看:204
本文介绍了启动Google App Engine Web服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PHP浏览Google App Engine的helloworld教程( https ://developers.google.com/appengine/docs/php/gettingstarted/helloworld )。获取应用程序并准备就绪后,教程会告诉我使用以下命令启动Google App Engine SDK附带的Web服务器:google_appengine / dev_appserver.py --php_executable_path = helloworld /。我该如何启动Web服务器,以及将该命令放在哪里?

I'm going through the helloworld tutorial for Google App Engine using PHP (https://developers.google.com/appengine/docs/php/gettingstarted/helloworld). After getting the application set up and ready to go the tutorial tells me to start the web server included with the Google App Engine SDK using the command: google_appengine/dev_appserver.py --php_executable_path= helloworld/. How exactly do I start the web server and where do I put that command in?

推荐答案

在您的机器上安装SDK ,您将拥有一个google_appengine目录。我运行Windows,使其位于: $ b

After you install the SDK on your machine you'll have a google_appengine directory. I run Windows so mine is located at:


C:\程序文件(x86)\Google\google_appengine

C:\Program Files (x86)\Google\google_appengine

该目录内有一个名为dev_appserver.py的python脚本,这是本教程希望您运行的脚本。你的本地机器也应该安装PHP,并且脚本正在寻找这个位置,因为它会是你自己安装的。

Inside that directory is a python script called "dev_appserver.py" which is what the tutorial wants you to run. Your local machine should also have PHP installed and the script is looking for the location to that since it would be something you'd install yourself.

你将执行这个脚本从你操作系统的任何本地命令行应用程序(Linux的shell,Mac中的终端,Windows中的命令提示符或Powershell)中执行。

You'll execute this script from whatever local command line application your OS has (shell for Linux, terminal in Mac, Command Prompt or Powershell in Windows).

我的GAE应用程序被存储。为确保您可以正确执行此命令,请不带参数运行它,并且您应该看到以下内容:
$ b

I execute mine from the folder one level above my GAE application is stored. To ensure you can properly execute this command, run it with no parameters and you should see this:


pythonC:\程序文件(x86)\Google\google_appengine\dev_appserver.py

python "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py"

输出:

usage: dev_appserver.py [-h] [--host HOST] [--port PORT]
                        [--admin_host ADMIN_HOST] [--admin_port ADMIN_PORT]
                        [--auth_domain AUTH_DOMAIN] [--storage_path PATH]
                        [--log_level {debug,info,warning,critical,error}]
                        [--max_module_instances MAX_MODULE_INSTANCES]
                        [--use_mtime_file_watcher [USE_MTIME_FILE_WATCHER]]
                        [--threadsafe_override THREADSAFE_OVERRIDE]
                        [--php_executable_path PATH]
                        [--php_remote_debugging [PHP_REMOTE_DEBUGGING]]
                        [--python_startup_script PYTHON_STARTUP_SCRIPT]
                        [--python_startup_args PYTHON_STARTUP_ARGS]
                        [--blobstore_path BLOBSTORE_PATH]
                        [--mysql_host MYSQL_HOST] [--mysql_port MYSQL_PORT]
                        [--mysql_user MYSQL_USER]
                        [--mysql_password MYSQL_PASSWORD]
                        [--mysql_socket MYSQL_SOCKET]
                        [--datastore_path DATASTORE_PATH]
                        [--clear_datastore [CLEAR_DATASTORE]]
                        [--datastore_consistency_policy {consistent,random,time}]
                        [--require_indexes [REQUIRE_INDEXES]]
                        [--auto_id_policy {sequential,scattered}]
                        [--logs_path LOGS_PATH]
                        [--show_mail_body [SHOW_MAIL_BODY]]
                        [--enable_sendmail [ENABLE_SENDMAIL]]
                        [--smtp_host SMTP_HOST] [--smtp_port SMTP_PORT]
                        [--smtp_user SMTP_USER]
                        [--smtp_password SMTP_PASSWORD]
                        [--prospective_search_path PROSPECTIVE_SEARCH_PATH]
                        [--clear_prospective_search [CLEAR_PROSPECTIVE_SEARCH]]
                        [--search_indexes_path SEARCH_INDEXES_PATH]
                        [--clear_search_indexes [CLEAR_SEARCH_INDEXES]]
                        [--enable_task_running [ENABLE_TASK_RUNNING]]
                        [--allow_skipped_files [ALLOW_SKIPPED_FILES]]
                        [--api_port API_PORT]
                        [--automatic_restart [AUTOMATIC_RESTART]]
                        [--dev_appserver_log_level {debug,info,warning,critical,error}]
                        [--skip_sdk_update_check [SKIP_SDK_UPDATE_CHECK]]
                        [--default_gcs_bucket_name DEFAULT_GCS_BUCKET_NAME]
                        yaml_files [yaml_files ...]
dev_appserver.py: error: too few arguments

使命令正常工作的原因是:

My command to get this working properly was:

python "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py" --port 8082 --admin_port 8083 --php_executable_path "C:\Program Files (x86)\NuSphere\PhpED\php54\php-cgi.exe" helloworld\

我在Powershell中得到了这个输出,并且能够击中本地URL并查看Hellow, World!

I got this output in Powershell and was able to hit the local url and see "Hellow, World!"

INFO     2013-10-22 16:04:27,039 sdk_update_checker.py:245] Checking for updates to the SDK.
INFO     2013-10-22 16:04:28,368 sdk_update_checker.py:261] Update check failed: HTTP Error 404: Not Found
WARNING  2013-10-22 16:04:28,398 api_server.py:332] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO     2013-10-22 16:04:28,405 api_server.py:139] Starting API server at: http://localhost:52150
INFO     2013-10-22 16:04:28,408 dispatcher.py:171] Starting module "default" running at: http://localhost:8082
INFO     2013-10-22 16:04:28,411 admin_server.py:117] Starting admin server at: http://localhost:8083
INFO     2013-10-22 16:04:31,980 module.py:608] default: "GET / HTTP/1.1" 200 13
INFO     2013-10-22 16:04:32,223 module.py:608] default: "GET /favicon.ico HTTP/1.1" 200 13

这篇关于启动Google App Engine Web服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆