Board logo

标题: [源码程序] 在Google GAE上通过JAVA运行PHP程序 [打印本页]

作者: 錯じ☆ve涅槃    时间: 2010-4-24 01:23     标题: 在Google GAE上通过JAVA运行PHP程序

现在GAE已经至此java了,但不幸的是PHP任然毫无音讯。但是我们在google官方支持PHP之前我们可以使用基于java的Quercus。Quercus基本上可以100%的支持PHP语言(需要JDK1.5)。

现在我们开始用GAE运行PHP:

1) 注册一个免费的GAE帐户 。
2) 下载此文件到您的计算机(如果连接失效大家可以搜索phpwithgae便可以下载到它,如还不行就给我留言吧。)。
3) 修改war\WEB-INF\appengine-web.xml ,将phpwithgae换成你自己的GAE名字。
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
  3.     <application>phpwithjava</application>
  4.     <version>1</version>
  5.     <!-- Configure java.util.logging -->
  6.     <system-properties>
  7.         <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
  8.     </system-properties>
  9.     <!-- For PHP-Support -->
  10.     <static-files>
  11.         <exclude path="/*.php" />
  12.     </static-files>
  13.     <resource-files>
  14.         <include path="/**.php" />
  15.     </resource-files>
  16. </appengine-web-app>
复制代码
4) 最后上传您的程序 。(下载谷歌appengine SDK for Java ,并使用下面的命令 。
appcfg.cmd update C:\projects\phpwithjava\war)

To see this in action just visit:看到这一行动只需访问:
http://phpwithjava.appspot.com/webdigi.php and http://phpwithjava.appspot.com/info.php http://phpwithjava.appspot.com/webdigi.phphttp://phpwithjava.appspot.com/info.php




欢迎光临 【精灵影音分享社区】 (http://51.nie.ge/) Powered by Discuz! 7.2