On Sat, 28 May 2011 18:46:52 +0100, Arnold Hesnod <ahes...@mindvox.com> wrote:

I sent this message to the php-general list, but haven't gotten any replies. Looking at the archives for the two lists, I realized that I'm probably much more likely to get informed responses from this list than the general list:


I doubt it. This is the same list that doesn't see the point of annotations or wants them pushed to documentation blocks. Since annotations have been a central part of the last 100 or so JSRs and I've only seen one or two informed objections, it's fairly obvious the list has had very little experience with Java.


[...]

The cancellation of PHP 6 combined with the steady trickle of PHP-related bugs and security vulnerabilities that have become public over the past few years had made me very nervous about the future of the platform. Having an open-source implementation of PHP that runs on the JVM, which is like the gold standard for server application performance and reliability, is reassuring. The fact that it makes it easy and fast to use the huge library of Java frameworks out there in your PHP applications doesn't hurt either.

The security vulnerabilities may have been overstated. It's true there are plenty of ways to crash PHP, but this is mostly by running specific scripts. It's not very frequently that remotely exploitable bugs are found.


Although I've had great results so far in my experiments with Quercus, I'm curious to hear about other PHP developers' experiences with it. Even though it seems like a significant number of people are using it for production applications, I'm curious why it's adoption isn't even higher than it is? Given the difficulties of writing a Virtual Machine, it seems like leveraging the JVM is a no brainer. Is there some technical drawback that I'm unaware of or is it just a case of inertia?


I've heard about Quercus for several years but never really tried it. Recently, I tried to use it as a view engine for Spring Surf web scripts, but then got distracted with something else and abandoned it.

Anyway, I decided to give it another try and attempted to run a PHP application I wrote under Quercus. This is my experience:

The first thing I noticed is the Maven repository ran by the company -- http://caucho.com/m2/ -- had an artifact named resin-quercus. However, this seems to a fairly old version (3.2.1) from 2008. I then checked the site and the quercus specific pages always referred to 3.x versions. The resin artifact contained more up-to-date versions, however, it's a complete Java Application Server. So Quercus, as a standalone product, seems to be discouraged. In order to use Quercus, they try to push their crippleware open-source application server, in the hope you'll buy their paid product. Nothing wrong with that, it's certainly preferable to a full closed-source strategy, but you have to wonder whether at some point further development in Quercus (or part of it) may move to the paid version.

FUD apart, I continued and added the full resin 4.0.17 artifact as a runtime dependency, added the servlet to the descriptor and tried to run my PHP application. I immediately hit two problems:
* htmlentities() will only take 3 arguments, not 4.
* error_get_last() doesn't exist.

I then tried to work around this to get something vaguely functional, but then hit what seems to a bug in the postgresql module implementation -- pg_query_params will return false in non-select statements, even though there's no error (see PostgresModule.executeInternal). This took me stepping through the source code to realize because there was absolutely no log statement and, of course, pg_last_error would give nothing.

Then I had another problem, which I don't recall, at which point I gave up.

My conclusion is that Quercus is far from being a drop-in replacement for PHP. If you're writing an application from scratch, it might be a good option (I can't tell). It is probably a very good option if you need interaction with Java and for some reason exposing it with a web service is not an option.

--
Gustavo Lopes

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to