无法启动Google App Engine PHP教程 [英] Unable to get Google App Engine PHP tutorial working

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

问题描述

我正在关注 GAE PHP教程但是我无法让本地开发服务器正确响应.

I'm following the GAE PHP tutorial but I can't get the local dev server to respond properly.

我用

dev_appserver.py --php_executable_path=/usr/bin/php --host=192.168.33.44 ./

,它可以正常启动.当我查看http://192.168.33.44:8080/时,日志显示

and it starts up fine. When I view http://192.168.33.44:8080/ the logs show

INFO 2016-10-12 07:55:06,264 module.py:788] default: "GET / HTTP/1.1" 200 -

但是我得到了空白页.教程中没有任何内容说明如果遇到问题该怎么办.

but I get a blank page. There's nothing in the tutorial explaining what to do if you have problems.

到目前为止,我已经:

  • 尝试过PHP 5.5和5.6(remi):没有区别
  • 将损坏的PHP放入helloworld.php:没有错误
  • 将处理程序更改为- url: /:/的空白页,其他任何URL的404页
  • 精练的Google文档:没有帮助
  • 精练的Google:没有帮助
  • 问橡皮鸭:没有帮助
  • Tried PHP 5.5 and 5.6 (remi): no difference
  • Put corrupt PHP in helloworld.php: no errors
  • Changed the handler to - url: /: blank page on /, 404 page for any other URL
  • Scoured Google Docs: no help
  • Scoured Google: no help
  • Asked the rubber duck: no help

我正在通过Vagrant和Google Cloud SDK 129.0.0运行Centos 7.2.

I'm running Centos 7.2 via Vagrant and Google Cloud SDK 129.0.0.

任何人和所有帮助都将不胜感激.

Any and all help greatly appreciated.

根据要求提供其他数据

$ which php
/usr/bin/php


$ /usr/bin/php -v
PHP 5.5.38 (cli) (built: Sep 19 2016 13:45:10)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies


$ which python
/usr/bin/python


$ /usr/bin/python -V
Python 2.7.5

$ cat app.yaml
runtime: php55
api_version: 1

handlers:
- url: /.*
  script: helloworld.php


$ cat helloworld.php
<?php

echo 'Hello, World!';


$ dev_appserver.py --php_executable_path=/usr/bin/php --host=192.168.33.44 ./


Updates are available for some Cloud SDK components.  To install them, please run:
$ gcloud components update

INFO     2016-10-13 08:21:22,699 devappserver2.py:769] Skipping SDK update check.
INFO     2016-10-13 08:21:22,730 api_server.py:205] Starting API server at: http://localhost:46453
INFO     2016-10-13 08:21:22,737 dispatcher.py:197] Starting module "default" running at: http://192.168.33.44:8080
INFO     2016-10-13 08:21:22,738 admin_server.py:116] Starting admin server at: http://localhost:8000
INFO     2016-10-13 08:21:34,142 module.py:788] default: "GET / HTTP/1.1" 200 -

访问 http://192.168.33.44:8080/

Cache-Control: no-cache
Content-Length: 0
Content-Type: text/html
Date: Thu, 13 Oct 2016 08:21:34 GMT
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Server: Development/2.0

我从129更新为130,但是存在相同的问题

I updated from 129 to 130 but the same problem exists

推荐答案

原来的问题是疏忽大意...

Turns out the problem was a trivial oversight...

dev_appserver.py --php_executable_path=/usr/bin/php --host=192.168.33.44 ./

应该是

dev_appserver.py --php_executable_path=/usr/bin/php-cgi --host=192.168.33.44 ./

App Engine 需要php-cgi二进制文件,而不是cli.不久前最终在文档中绊了一下,但忘了回到这里并发布答案

The App Engine requires the php-cgi binary, not the cli one. Ended up stumbling over it in the docs a while ago, but forgot to come back here and post the answer

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

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