PHP in GlassFish, first steps

This blog from Ludo on PHP running in GlassFish thanks to Caucho’s Quercus (small video here) opens up a lot of possibilities: portability, performance, access to Java EE libraries such as JAX-WS or JPA, integration with server-side Java code, etc. Kudos to Caucho. Sounds like GlassFish and Quercus can do great things together.

As an alternative to Ludo’s approach, I created a separate GlassFish domain (using my newly discovered -portbase feature of course) called PHP_domain and edited $GLASSFISH_INSTALL/domains/PHP_domain/config/default-web.xml to add the Quercus servlet definition and the associated .php servlet mapping (see Ludo’s blog for details). I simply unzipped my favorite PHP application (phpBB) with no deployment or special packaging whatsoever in the docroot directory of the domain. It can’t get much easier than that. Of course you’re back to web-apps if you want to leverage any Java EE features.

Update: I’ve uploaded this archive to automate the above steps. Download it to you glassfish root directory, unzip it and create the PHP-enabled domain:

ant -Dquercus.war.file=/path/to/quercus-3_1-snap.war -f setup-php.xml

While you’re at it, you may want to look at jMaki‘s PHP capabilities and project lightbulb for SAML for the PHP world.

Finally, you may want to listen to this brief interview of Resin’s chief architect Scott Ferguson (only the intro is in French) from the last JavaPolis conference:

Author: alexismp

Google Developer Relations in Paris.