Google App Enging for Java 用來跑 PHP

前幾天 google 發布了 google app engine 支援了 java 後,就有聽說有人可以利用 Quercus 專案,來支援 PHP ,這是一個令人興奮的消息啊。像我不太會寫 python 的人,有 PHP 的支援,更可以讓更多的 web developer 快速上手。

幾天後,有一家公司的 blog 上發表了一篇「Run PHP on the Google App Engine」,他們已經成功的在 app engine 上執行 php 了。

他所列的步驟如下:

  1. Register a free account.
  2. Download this file to your computer.
  3. Edit application XML tag in the file war\WEB-INF\appengine-web.xml to the name of the application you have registered.
  4. Finally upload your application. I downloaded Google App Engine SDK for Java and use the following command in windows.

但我在本地端測試的時候,因為少了一些 package 所以沒辦法在本地端執行,你可以到 http://www.codehaus.org/ 下載 jetty package ,並且解壓縮到 app-engine 的 lib 目錄,即可以使用 dev_appserver.sh 這個指令在本地端測試了。Depoy 到 google 的 GAE 上的話,就不用這這個 package 了。

另外他沒有支援 Mysql 之類的關聯性資料庫,所以如果要 port 一些跟資料庫相關的東西的話,應該要自行改寫其資料庫的部份。