Image pour le titre du contenu

Ce document est aussi disponible en français fr 

I do remember my long study of the personal computer market, in the early 90's, when I decided to move from my antic Apple ][c to a much more modern Apple Macintosh LC : among the reasons that were driving my brother Ghislain and I toward this choice, besides the parental funds and our good friend Olivier, there was the capacity to use all our olds programs (they were not yet applications) on the new machine. The Mac LC had an optional emulation card, that allowed such magic.

Looking back at the past, of course, we got our LC pizza box, but never made it as far as running our old programs on the new hardware. I'd be delighted to spend a nostalgic night, reading again my first steps in basic and old documents (I know where all my 5 1/4 floppy disk are, along with the machine). This would be quite a unique night, and probably limited to a party with Ghislain. Past is long past, and tomorrow will be another day.

This strange introduction is actually raising about the same feelings that when I read blogs and articles about server running PHP 4 and PHP 5 in the same time. This subject was hot at the birth of PHP 4 (running PHP 4 and PHP 3, or course), and it is coming back with a vengeance for PHP 5, backed by the immense user base of PHP 4. If PHP 5 is the default installation in 2008, what will happen to all those users? Of course, the right answer is to run both PHP 4 and PHP 5, to ensure a seamless migration. Everyone knows that.
Indeed, solutions do exist : using a proxy that will direct requests to a hidden PHP 4 or PHP 5 enabled server, depending on requirement; a double installation on the same web server, using CGI and module, based on domain name  ( and ; using differents eponym extensions, .php4 and .php5; configuration the web server by folder (; etc. Those articles and solutions are published regularly, and if you're running out of ideas for this set up, you can always rely on PHP 3 to PHP 4 migration articles (

Multiple PHP installation indicators

Based on this observation and my earlier experience of cohabitation, I wondered if there was any indicator of multiple PHP installation. Indeed, I had a friend who could help me on this task : the faithful robot of PHP version tracker, who is tracking PHP version across the world.

To identify distinct installations, I used the IP addresses. For every distinct IP address the robot spotted, I checked if it was holding two or more domains. From those IP addresses, I then checked if there was distinct PHP version installation on those domains.

Results are the following :

95% of installations are always using the same PHP version throughout the server. 5% are using 2 distinct PHP versions, and 0.0086% are using PHP 3, 4 and 5 at the same time. Basically, a small minority of webmasters are trying to run both versions at the same time, and no one (OK, 1 guy), is trying to support all versions.

Multiple PHP installation by versions

Of course, major versions (3,4,5, no 1, 2, 6 or 9) are a too rough an information, so I ran the same stats with exact versions (such as 5.2.0, 5.2.1, 4.4.7, 3.0.18, etc). Absolute figures are now slightly higher than the previous study, since we are now including multiple installations inside a major version : webmaster migrating from PHP 4.3.10 to 4.4.7 were not counted in the first study, but are now identified.

The most amusing part is that some IP show up to 16 (sixteen!) distinct PHP versions : and there are several of them, though not even half a dozen).

Now 93,14% are only relying on one PHP version, and 6,37% are using 2 : this is a 0.3% difference from the first study. All more complex installations are even less popular, as expected. We may keep an official estimation : 6% of webmasters are using multiple PHP versions. This is close to my own estimation of 1 out of 20.


In a few word, there is definitely a market for multiple-PHP version installations, but it is a pretty small one. Even as the PHP user base is really huge, that means that not too many people are trying this adventure. It is probably better to move the code, adapt it, rewrite it or forget it, than trying to "smooth migration" by running two versions at the same time. It is definitely possible, but think about it twice before trying it.

More fun with figures

While working on this article, I asked myself yet another question : could be measure the actual compatibility level of two PHP versions by counting the number of double installations realized? The concept is the following : if two PHP versions are very incompatible, then more users will try to secure themselves by setting a double installation. Most users (say, around 90%) will make it without major problem, while a remaining frightful 10% will try to run both versions to make sure all is right. This percentage will raise if two PHP versions are showing migrations problems.

We could then try to define some compatibility indice : that could be the percentage of double installations over the final installations. Here are some cabalistic figures, for the intrepid :

versions brut relative refined
3.0 248 36.80 7359.05
4.0 65 2.19 220.64
4.1 139 2.79 128.53
4.2 164 3.88 204.88
4.3 2526 3.96 14.56
4.4 13953 14.57 31.84
5.0 586 6.66 196.07
5.1 1841 10.40 150.48
5.2 11464 43.22 370.01

The 'brut' column has the number of sites using the version in the first column. The 'relative' column is the previous column divided by the number of sites using only the final PHP version; last, the 'refined' column is the previous value, multiplied by each version market share. If you're like me, final figures are still hard to understand...

If you want to tweak those figures more, here are every figures of double installations, and their counts.

If you have an idea to be more clever with those figures, I'll be happy to talk about it.

3.0 4.0 4.1 4.2 4.3 4.4 5.0 5.1 5.2
3.0 246 16 24 16 50 170 1 0 7
4.0 16 251 19 23 53 209 18 25 33
4.1 24 19 593 21 88 519 25 42 244
4.2 16 23 21 872 127 806 27 190 112
4.3 50 53 88 127 2230 1084 125 373 404
4.4 170 209 519 806 1084 12966 113 734 9200
5.0 1 18 25 27 125 113 396 49 77
5.1 0 25 42 190 373 734 49 1498 329
5.2 7 33 244 112 404 9200 77 329 10696

You may see that there are large numbers of multiple PHP install for one middle version : those are double install, of type 4.4.4 and 4.4.7. Each time, they are more and more.

Final note : I did look for a way to produce a graph with those figures, in 3D, along 2 axis such as this image  but I couldn't find any applications that could do it, may it be jpgraph, microsoft Excel, Open Office ou KeyNote. If you have any clue of an application doing that kind of graphing, ideally working on Mac OS X, drop me a note.


Vous pouvez ajouter votre commentaire!

Vous devez vous connecter pour commenter