By adding Java to their App Engine, Google has opened the door for a whole slew of languages that have been implemented on the JVM, now including PHP via Quercus.
http://blog.caucho.com/?p=187
This very tutorial is deployed on GAE.
I must admit that I was pleasantly surprised by how effortless it was. OK, it's a very rudimentary PHP application, the only PHP code used was to run the examples described on the code blocks and do some includes; nevertheless I didn't feel the need to change a single line of code.
Also, deploying a Java application to GAE is simpler than a Python one. Not only because you have a very handy
Eclipse plugin, but you will also find configuring the file appengine-web.xml a lot
easier when compared to app.yaml.
myProject/
src/
...Java source code...
META-INF/
...other configuration...
war/
...JSPs, images, data files...
WEB-INF/
...app configuration...
lib/
...JARs for libraries...
classes/
...compiled classes...
myProject/war.quercus.war/WEB-INF/lib to
myProject/war/WEB-INF/lib.
web.xml. Mine looks like this:
<pre lang="xml" file="web.xml">
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<description>PHP Tutorial</description>
<servlet>
<servlet-name>Quercus Servlet</servlet-name>
<servlet-class>com.caucho.quercus.servlet.GoogleQuercusServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Quercus Servlet</servlet-name>
<url-pattern>*.php</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.php</welcome-file>
</welcome-file-list>
</web-app>
appengine-web.xml. Mine looks like this:
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>php-tutorials</application>
<version>1</version>
<!-- Configure java.util.logging -->
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties" />
</system-properties>
<static-files>
<include path="/**" expiration="600s" />
<include path="/**.png" expiration="30d" />
<include path="/**.jpg" expiration="30d" />
<include path="/**.gif" expiration="30d" />
<include path="/**.ico" expiration="30d" />
<include path="/**.swf" expiration="30d" />
<include path="/**.css" expiration="7d" />
<include path="/**.js" expiration="2d 12h" />
<exclude path="/**.php" />
</static-files>
<resource-files>
<include path="/**.php" />
</resource-files>
</appengine-web-app>
Run your application using the Run As » Web Application command and point your browser to http://localhost:8888/.
Finally, press the Deploy App Engine Project button to deploy to Goole App Engine and point your browser to your application root to see it in action http://my-application-id.appspot.com/.