2016-08-02 60 views
0

我閱讀了關於GAE模塊的文檔。這sample application顯示如何在GAE應用程序中使用模塊。我已經修改了一些代碼,以便使用這兩個php and python languages應用引擎PHP模塊不工作

以下是相應代碼所在的​​。

當我嘗試運行以下命令

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

我所有的本地機器上運行該應用程序,除了用PHP編寫的代碼工作正常。當我嘗試通過觸發這個localhost:8080/mobile/訪問該特定部分時,我得到一個空白頁面而不是Hello World

+0

您在日誌中看到了什麼? –

+0

在日誌上,它不會顯示任何錯誤,只需GET/mobile/200 –

+0

您可以在運行'dev_appserver.py'命令後添加完整日誌嗎? –

回答

1

我已經跑了你的代碼沒有問題。

php module python module

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 

嘗試以下操作:

  • 安裝使用gcloud components install app-engine-php
  • 所有必要的PHP擴展省略--php-executable-flag
  • 確保它與在命令which php正確你的終端,並將--php-executable-flag指向您的php-cgi
+0

但沒有'--php-executable-flag',它顯示錯誤.. –

+0

你看到了什麼錯誤?'哪個php'告訴你什麼? –

+0

'哪個php顯示'/ usr/bin/php' –