PHP Install Statistics

  1. 1. UPDATE:
  2. 2. What Is A Secure And Supported Version?
  3. 3. PHP 5.6
  4. 4. PHP 5.5
  5. 5. PHP 5.4
  6. 6. PHP 5.3
  7. 7. PHP 5.2
  8. 8. PHP 5.1
  9. 9. Totalling It Up:
  10. 10. This Is Pathetic

After yesterday’s post, I decided to do some math to see how many PHP installs had at least 1 known security vulnerability. So I went to grab statistics from W3Techs, and correlated that with known Linux Distribution supported numbers. I then whipped up a spreadsheet and got some interesting numbers out of it. So interesting, that I need to share…


Wow, this post got traction pretty fast. I started applying the same analysis to other platforms (where w3techs had data). Rather than doing a new post, I’ll just like the raw data in a Google Sheet (If you want to edit, just duplicate the sheet. Everything is formula driven so update away).

So, what’s the breakdown?

Platform% Installs That Are Secure

Note that the PHP version numbers are slightly higher than in the rest of this post. This is due to adding Fedora, as well as 5.4.34 to Debian 7 support list (over-counting Debian 7 again).

What Is A Secure And Supported Version?

Well, for purposes of this analysis, we’ll call versions that have no known vulnerabilities (more recent than the most recent security release) secure.

That gives us the following secure versions:

  • 5.6.4
  • 5.5.20
  • 5.4.36
    We’ll also count those that are maintained by Linux distributions in supported releases. For example, Debian 5.0 is no longer maintained, so the version of PHP it ships with is considered no longer supported or secure (5.2.6).

So that brings us with the following table:

DistributionDistro VersionPHP Version
Debian7 (Wheezy)5.4.4
Debian6 (Squeeze)5.3.3
Ubuntu14.10 (Utopic)5.5.12
Ubuntu14.04 (Trusty)5.5.9
Ubuntu12.04 (Precise)5.3.10
Ubuntu10.04 (Lucid)5.3.2

Now, for our purposes, we’ll assume that any 5.4.4 install will be secure, since we can’t distinguish Debian versions (supported) from non-Debian installs (unsupported).

This means that our “secure” numbers will be over-inflated. But let’s plug it in and see what happens.

So that means our total list of secure PHP versions (with no known vulnerabilities) is:

  • 5.6.4
  • 5.5.20
  • 5.5.12
  • 5.5.9
  • 5.4.36
  • 5.4.16
  • 5.4.4
  • 5.3.10
  • 5.3.3
  • 5.3.2
  • 5.1.6

    PHP 5.6

So, looking at the W3Techs numbers, we can see that 5.6 has a total adoption rate of 0.4%. This means that 0.4% of all PHP installs use 5.6.x. So let’s look at the breakdown:

Version% Of Minor% Of TotalSecure?

So, 6.7% of all PHP 5.6 installs are running 5.6.4, and are therefore secure (since it’s the only secure and maintained PHP 5.6 version).

So, correlating that to our list of secure PHP versions, we come up with the following breakdown for 5.6:

Type% Of Minor% Of Total
Insecure 5.693.30.3732

So only 6.7% of PHP 5.6 installs are running secure versions. And only 0.0268% of all PHP installs are running a secure version of PHP 5.6…

PHP 5.5

PHP 5.5 is a bit more interesting, with a total adoption of 6%. And there are a lot more releases to look at:

Version% Of Minor% Of TotalSecure?

Things look a bit better here.

Type% Of Minor% Of Total
Secure 5.536.62.196
Insecure 5.563.43.804

Our total increased here. 33.6% of all 5.5 installs are running secure versions. This is MUCH better than 5.6, but still horrifically low…

PHP 5.4

With PHP 5.4 we again see a huge jump in overall adoption at 26.4% of all PHP installs. So let’s break it down by version:

Version% Of Minor% Of TotalSecure?

Things look far more grim again here:

Type% Of Minor% Of Total
Secure 5.410.62.7984
Insecure 5.489.623.6544

Note here that the total is 100.2%. This is due to precision errors in the figures reported by W3Techs. But it shouldn’t affect our overall figures.

So 89.6% of 5.4 installs are vulnerable. Yay.

PHP 5.3

Now we get to the big one. Accounting for a whopping 45.9% of all PHP installs, 5.3 hits big. So let’s look at the numbers:

Version% Of Minor% Of TotalSecure?

The case here is almost identical to 5.5:

Type% Of Minor% Of Total
Secure 5.333.915.5601
Insecure 5.366.130.3399

Not much else to comment on here.

PHP 5.2

Note that PHP 5.2 is not maintained by any current release of any of the 3 main distributions. Therefore, we can safely skip the version-by-version breakdown and jump right to the conclusion:

Type% Of Minor% Of Total
Secure 5.200
Insecure 5.210020.1

PHP 5.1

PHP 5.1 accounts for 1.2% of all PHP installs. So let’s break it down:

Version% Of Minor% Of TotalSecure?

And totaling:

Type% Of Minor% Of Total

So the situation here is actually quite good, with 94.8% of all 5.1 installs being secure.

But it’s 5.1…

Totalling It Up:

Let’s sum up all of the total columns:

Type% Of Total

These numbers are optimistic. That’s because we’re counting all version numbers that are maintained by a distribution as secure, even though not all installs of that version number are going to be from a distribution. Just because 5.3.3 is maintained by CentOS and Debian doesn’t mean that every install of 5.3.3 is maintained. There will be a small percentage of installs that are from-source.

Therefore, the real “secure” number is going to be less than quoted.

Additionally, it also assumes that the distribution installs are always updated. So just because you’re running Debian’s 5.3.3 doesn’t mean you’ve got all of the latest patches and updates for it.

So 21.71% is an upper bound on the number of secure installs.

This Is Pathetic

This is absolutely and unequivocally pathetic. This means that over 78% of all PHP installs have at least one known security vulnerability. Pathetic.

Check your installed versions. Push for people to update. Don’t accept “if it works, don’t fix it.”… You have the power to change this, so change it.

Security is everyone’s problem. What matters is how you deal with it.