Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Quercus a viable replacement for PHP in Java environments?

Tags:

java

php

quercus

For anyone stumbling upon this question who doesn't know what Quercus is - it is an implementation of PHP done in Java.

For a project that I am currently working on we serve php pages via cgi over servlets (I know it is clunky, but it is a requirement to support legacy code). I was excited to discover the Quercus project because it looked like a promising path to move our project to a more pure Java environment.

I have a few questions regarding Quercus:

  • Have you used Quercus in a shipping product?
  • How much of the php API is supported?
  • What are any gotchas you have had working with it?
  • Have you been able to make it work with Jetty? Have you ever heard of it working with Jetty? (I couldn't figure it out)
like image 659
Elijah Avatar asked Apr 22 '09 14:04

Elijah


1 Answers

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.

like image 107
Brent Baisley Avatar answered Sep 27 '22 20:09

Brent Baisley