There's a really easy way to get PHP running on Google's app engine, see this great link:
http://www.webdigi.co.uk/blog/2009/run-php-on-the-google-app-engine/
In short, it works by using 'Quercus' which likely takes the php scripts, transforms and compiles into java bytecode that gets run in the JVM. Don't understand all that? No problem, the important note it is seems to work well.
So far I've tested two pieces of code:
Memcache
import com.google.appengine.api.memcache.MemcacheService;
import com.google.appengine.api.memcache.MemcacheServiceFactory;
import com.google.appengine.api.memcache.Expiration;
$service = MemcacheServiceFactory::getMemcacheService();
$expiration = Expiration::byDeltaSeconds(60);
echo 'MEMCACHE::get(): ' . $service->get("key1") . "
";
$service->put("key1", "hello", $expiration);
echo 'MEMCACHE::get(): ' . $service->get("key1") . "
";
?>
Works great.
Now, probably the most important reason to use App Engine? Access to your very own google database! Running scalable web services just got a whole lot easier.
The bad news is there's no good interface or classes yet with php, so you have to go through using google's 'raw' datastore API.
Datastore
import com.google.appengine.api.datastore;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
$data = array('test' => 1,
'test2' => 2);
$entity = new Entity("MV_Storage_Php");
$entity->setProperty("value", serialize($data));
echo "KEY: ". (string)$entity->getKey(); // ok - unknown
echo "VALUE: ". (string)$entity->getProperty("value"); // ok
$dataService = DatastoreServiceFactory::getDatastoreService();
foreach($dataService->getActiveTransactions() as $t) {
echo "TRANS: ". $t->getId(); // none
}
$dataService->put($entity); // throws NULL exception!?
echo $entity->getKey();
?>
Unfortunately, it throws a NULL exception. So aside from the quirks, it looks promising.
The Datastore API is documented
here.