PHP’s anti-Apache2 FUD

My biggest objection to PHP is the anti-Apache2 FUD that they spread. Indeed, they seem to be the ones primarily responsible for the anti-Apache2 FUD. This is unfortunate, since there are few remaining legitimate reasons for avoiding Apache2, and it’s a shame that they feel the need to manufacture one.

So, to quote the PHP docs:

Do not use Apache 2.0.x and PHP in a production environment neither on Unix nor on Windows.

This is further clarified in the FAQ with a long description which starts, unfortunately, with a misconception, namely:

The major feature that draws people to Apache 2 is threading.

It then goes on to explain why threading is, potentially, a problem with PHP, why this is not, technically, PHP’s fault, and so PHP cant fix it. All very correct, really. And, so, very logically, it concludes that there’s no reason to move to Apache 2, and that everyone should stick with Apache 1.3.

This argument suffers from one main flaw. That is, that the initial assumption, from which everything flows, is just plain wrong.

Yes, threading is cool, and is a major shinyness with Apache 2. However, it is not, by any stretch of the imagination, the only, or even the main, reason for moving to Apache 2.0. There are a *lot* of other much better reasons for moving to Apache 2.0, none of which pose any threat to PHP. I’ve covered those in my OnLamp article, and so won’t repeat them here. Apache 2.0, running with a prefork MPM, works great with PHP, and gives you all those other benefits.

The additional benefit is a little more subtle. Apache 1.3 is becoming “legacy”. Meaning that the real developers are focusing more on 2.0. The 2.0 docs are better. 2.0 (and 2.1) gets the new features, the documentation improvements, and the newly clarified directives and error messages. Thus, 1.3 becomes harder and harder to support. So, increasingly, the PHP questions are coming from folks that are running 1.3, and the solutions offered just don’t work, because they are things added in 2.0 to solve exactly the irritations that these folks are having.

So, I entreat the PHP folks to remove this incorrect anti-Apache 2.0 tirade from their documentation, and replace it with a more balanced and correct explanation of the issues involved, and the recommended solution. Namely, that people go ahead and move to Apache 2.0, but stick with a Prefork MPM. This gives them most of the benefits of Apache 2.0, but removes the irritating threading issues. Nobody blames PHP for those threading issues (at least, people who have taken the trouble to actually understand the issue don’t), so there’s no slight on the PHP developers implied here. I’d be glad to participate in this to any degree that you like. I actually enjoy writing documentation, and I’m increasingly using PHP for my own work.

Please?