PHP’s the New Java

While our overriding impression was that the Rich Internet Application was the predominant theme of this year’s JavaOne, we did stumble across one potentially interesting server development. Caucho, a 10-year old firm that we’ve never heard of, has recently reached a major milestone in its 3-year effort porting PHP over to Java. That is, it’s taken the underlying constructs of PHP, which are written in C and C++, and reimplemented them in Java. The result is kind of you-can-have-it-both-ways deployment platform for PHP.

The result is Resin, an open source appserver that lets you write your web app in PHP, but run it on a server that takes advantages of most (not all) of the Java EE services of brand name appserver platforms. In other words, you get the reliability, load balancing, and other bulletproofing features of Java EE, but you don’t have to write Java. It’s drawn several major PHP sites, which the company cannot disclose, but does brag how Japan’s largest online gaming portal migrated from Tomcat to Resin.

Caucho doesn’t claim to have the job finished; in fact, given the impedance mismatches between PHP and Java, it never will be a 100% artifact-for-artifact translation. For starters, there’s the immaturity and rough edges of PHP, which still isn’t fully documented and has its share of bugs. But the company has attained compatibility with PHP 6 and now supports some of its most popular apps like the Drupal social networking-oriented content management system, WordPress blogging platform, and MediaWiki engine that powers Wikipedia.

We never heard about Caucho before, but given PHP’s popularity and the current tooling vacuum surrounding it, we couldn’t ignore these obscure folks. PHP and other dynamic scripting languages like Perl, Python, and Ruby have emerged as responses to Java’s complexity. In essence, Caucho Resin is yet one of a number of responses (like “rebel” frameworks such as Spring or Hibernate) to the complexity of Java EE – and the idea of writing PHP appservers seems to be catching. Reportedly, IBM is also pursuing the idea.

Watch this space.