1

我正在尝试使用 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
4

2 回答 2

0

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

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

于 2013-06-08T04:13:40.427 回答
0
  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 代码错误。只需逐行调试它。

于 2016-09-13T13:48:42.387 回答