【问题标题】:Unable to run Google App Engine PHP on port 8080无法在端口 8080 上运行 Google App Engine PHP
【发布时间】:2013-06-08 02:39:34
【问题描述】:

我正在尝试使用 google app engine 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 上使用谷歌浏览器。

这是我的helloworld.php

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

还有我的app.yaml

application: helloworld
version: 1
runtime: php
api_version: 1

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

【问题讨论】:

  • 您是否启动了独立开发服务器?
  • 那么那个 url 上的 PHP 代码是什么?那可能有错误
  • @Paul 独立开发服务器是什么意思?我按照文档中的描述启动了服务器:google_appengine/dev_appserver.py --php_executable_path=php-5.4.15/installdir/bin/php-cgi appengine/helloworld/
  • @Hanky Panky PHP文件中的代码只是为了回显Hello World!

标签: php google-app-engine


【解决方案1】:

好的。解决方案很简单。 我没有在我的 ubuntu 上安装 apache 服务器。 安装 Apache 服务器 (sudo apt-get install apache2) 后,localhost:8080 按预期工作。

附: Google 在其文档的“安装 SDK”部分中没有提及任何有关安装 Apache 服务器的内容。

【讨论】:

  • 你应该不需要安装 apache 来让 dev_appserver 或 GAE SDK 工作。
【解决方案2】:
  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. 如果以上几点都没问题,那么可能是我的php代码错误。只需逐行调试它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-01-07
    • 1970-01-01
    • 2017-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-20
    • 2015-10-15
    相关资源
    最近更新 更多