Is Quercus a viable replacement for PHP in Java environments? Is Quercus a viable replacement for PHP in Java environments? php php

Is Quercus a viable replacement for PHP in Java environments?


I've tested it with WordPress and performance was almost double what a default WordPress install was under regular Apache/PHP. Which still isn't that great.

We did notice that while Quercus supports the curl commands in PHP, it doesn't support all the curl options. So automatic plugin downloads did not work. It wasn't that big of a deal, you can always download the plug-ins and install them manually. But this was a red flag since we didn't know what else would work. It also meant Facebook's PHP library wouldn't work right (most likely).

If you do a lot of database connections and calls, you should see a big performance boost in that area since database connection pooling will be used.

If you are writing the code, I would say it's a very viable option. Enough of PHP is supported that if you find something that doesn't work, you can use a different PHP command that is supported, or just use a Java command.


I did a little work evaluating Quercus and it looked promising, but did not work with the project I was working on, as it was Symfony based and the reflective nature of Symfony was not well handled by Quercus.

I did try getting a number of open source PHP projects working with it and found it to have a fairly complete PHP5 based API.

You should be able to get it working with Jetty. I was able to get it working with Tomcat.

You can really think of it as a replacement for JSP in a Java app. The way it works parallels how JSP works in that you compile PHP to Java code, just as you'd compile JSP to Java code.

I believe the big disadvantage of going with Jetty would be the inability to precompile the PHP code.

There are quite a few advantages, though, even if you aren't mixing PHP with Java. If you are mixing the two, you have even more advantages.


See link on how a developer managed to use Quercus to run PHP on the Google App Engine

NOTE: PHP is not officially supported in GAE but with Quercus you can run this now.