无法在8080端口上运行谷歌应用引擎PHP


Unable to run Google App Engine PHP on port 8080

我试图使用谷歌应用程序引擎php sdk。我正在阅读https://developers.google.com/appengine/docs/php/gettingstarted/helloworld .

它说我应该去http://localhost:8080/查看我的helloworld脚本。

但是浏览器遇到以下服务器错误:

Server error
The website encountered an error while retrieving http://localhost:8080/. It may be down     for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

我在Ubuntu 12.04上使用google chrome。

这是我的helloworld.php

<?php
echo "Hello World !";
?>

和我的app.yaml:

application: helloworld
version: 1
runtime: php
api_version: 1
handlers:
- url: /.*
script: helloworld.php

好的。解决办法很简单。我没有在我的ubuntu上安装apache服务器。在安装Apache服务器(sudo apt-get install apache2)之后,localhost:8080正常工作。

注:Google在其文档的"安装SDK"部分没有提到任何关于安装Apache服务器的内容。

  1. 看起来你安装了5.4。GAE只支持5.5
  2. 您是否完成了GAE运行时扩展设置?

    python dev_appserver.py --php_executable_path=/usr/bin/php-cgi   **--php_gae_extension_path=/var/www/html/appengine-php-extension/modules/gae_runtime_module.so** /var/www/html/project
    

    见:https://github.com/GoogleCloudPlatform/appengine-php-extension

  3. 如果以上几点是ok的,那么它可能是我php代码错误。逐行调试即可。