应用引擎PHP模块无法正常工作 [英] App engine PHP modules not working

查看:89
本文介绍了应用引擎PHP模块无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了关于GAE模块的文档。此

  dev_appserver.py dispatch.yaml app.yaml php.yaml static_backend.yaml 
INFO 2016-08-03 04:19:01,413 devappserver2.py:769]跳过SDK更新检查。
INFO 2016-08-03 04:19:01,517 api_server.py:205]启动API服务器:http:// localhost:52017
INFO 2016-08-03 04:19:01,520调度程序。 py:185]启动调度程序运行在:http:// localhost:8080
INFO 2016-08-03 04:19:01,526 dispatcher.py:197]启动模块default运行于:http:// localhost :8081
INFO 2016-08-03 04:19:01,718 dispatcher.py:197]启动模块php-module运行于:http:// localhost:8082
INFO 2016-08-03 04:19:01,734 dispatcher.py:197]启动模块static-backend运行在:http:// localhost:8083
INFO 2016-08-03 04:19:01,744 admin_server.py:116]启动admin服务器:http:// localhost:8000
INFO 2016-08-03 04:19:02,209 module.py:1730]模块php-module服务的新实例:
http: // localhost:8082

INFO 2016-08-03 04:19:02,759 module.py:1730]为模块static-backend服务的新实例:
http:// localhost:8083

INFO 2016-08-03 04:19:03,283 mod ule.py:788] php-module:GET / _ah / start HTTP / 1.1200 24
INFO 2016-08-03 04:19:03,470 module.py:788] static-backend:GET / _ah / start HTTP / 1.1200 3108
INFO 2016-08-03 04:19:15,683 module.py:788] static-backend:GET / mobile / HTTP / 1.1200 3752
INFO 2016-08-03 04:19:16,407 module.py:788] static-backend:GET /favicon.ico HTTP / 1.1200 3626
INFO 2016-08-03 04:19:18,914 module.py :788] static-backend:GET / mobile HTTP / 1.1200 3710
INFO 2016-08-03 04:19:19,345 module.py:788] static-backend:GET /favicon.ico HTTP / 1.1200 3650
INFO 2016-08-03 04:19:21,096 module.py:788] static-backend:GET / HTTP / 1.1200 3648

请尝试以下操作:


  • 使用 gcloud组件安装app-engine-php

  • 省略 - php-executable-flag
  • 使用命令确定它正确 on yo ur终端,并将 - php-executable-flag 指向您的 php-cgi


I read the docs about GAE's modules. This sample application shows how to use modules in a GAE app. I have modified the code little bit to use both php and python languages on that.

Here is the Github link where the corresponding code resides.

When I try to run this application on my local machine, by running this command

dev_appserver.py dispatch.yaml app.yaml php.yaml static_backend.yaml --php_executable_path /usr/bin/php

all works fine except the code written in php. When I try to access that particular part by triggering this localhost:8080/mobile/, I get an empty page instead of Hello World.

解决方案

I have ran your code without a problem.

dev_appserver.py dispatch.yaml app.yaml php.yaml static_backend.yaml 
INFO     2016-08-03 04:19:01,413 devappserver2.py:769] Skipping SDK update check.
INFO     2016-08-03 04:19:01,517 api_server.py:205] Starting API server at: http://localhost:52017
INFO     2016-08-03 04:19:01,520 dispatcher.py:185] Starting dispatcher running at: http://localhost:8080
INFO     2016-08-03 04:19:01,526 dispatcher.py:197] Starting module "default" running at: http://localhost:8081
INFO     2016-08-03 04:19:01,718 dispatcher.py:197] Starting module "php-module" running at: http://localhost:8082
INFO     2016-08-03 04:19:01,734 dispatcher.py:197] Starting module "static-backend" running at: http://localhost:8083
INFO     2016-08-03 04:19:01,744 admin_server.py:116] Starting admin server at: http://localhost:8000
INFO     2016-08-03 04:19:02,209 module.py:1730] New instance for module "php-module" serving on:
http://localhost:8082

INFO     2016-08-03 04:19:02,759 module.py:1730] New instance for module "static-backend" serving on:
http://localhost:8083

INFO     2016-08-03 04:19:03,283 module.py:788] php-module: "GET /_ah/start HTTP/1.1" 200 24
INFO     2016-08-03 04:19:03,470 module.py:788] static-backend: "GET /_ah/start HTTP/1.1" 200 3108
INFO     2016-08-03 04:19:15,683 module.py:788] static-backend: "GET /mobile/ HTTP/1.1" 200 3752
INFO     2016-08-03 04:19:16,407 module.py:788] static-backend: "GET /favicon.ico HTTP/1.1" 200 3626
INFO     2016-08-03 04:19:18,914 module.py:788] static-backend: "GET /mobile HTTP/1.1" 200 3710
INFO     2016-08-03 04:19:19,345 module.py:788] static-backend: "GET /favicon.ico HTTP/1.1" 200 3650
INFO     2016-08-03 04:19:21,096 module.py:788] static-backend: "GET / HTTP/1.1" 200 3648

Try the following:

  • Installing all necessary PHP extensions using gcloud components install app-engine-php
  • Omitting the --php-executable-flag
  • Making sure it is correct with the command which php on your terminal, and pointing the --php-executable-flag to your php-cgi

这篇关于应用引擎PHP模块无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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