So you’re a wanna-be developer who’d love to deploy in the cloud, but you only “know” PHP? Well, as you might already have read elsewhere Caucho, the company behind Resin, has a 100% Java GPL’ed implementation of PHP5 called Quercus that can be used to run PHP on GAE. It took me some time to put the pieces of the puzzle together, but in the end it’s pretty straightforward.
From scratch to a deployed webapp in 7 steps:
- Download & install the Google App Engine SDK
- Download this GAE project template for PHP and unzip it in the root of the SDK directory as projects/phptemplate/
- Put your PHP-files in projects/phptemplate/war/ (you probably want to overwrite index.php and remove phpinfo.php)
- Test you application locally with dev_appserver as described here
- Login on https://appengine.google.com/ and register a new application
- Put the app id from (5) in projects/phptemplate/war/WEB-INF/appengine-web.xml, between the
- Upload your application as described here: appcfg –enable_jar_splitting update
(–enable_jar_splitting is needed as the WEB-INF/lib/resin.jar is rather big)
And there you have it, your very own PHP-app on GAE! Check out the Quercus info on on how you can access Java components from within you PHP-code, it might come in very handy to use GAE’s Java API’s for the datastore, queues and all those other goodies!
(Disclaimer: while this here template seems to work, I can’t make any promises or provide any kind of warranty. As soon as you download it, you assume all responsibilities for any problems you might cause to the Internet, GAE or the Ozone-layer.)