Common Crawl is a fantastic project which provides search data to people. This provides an opportunity for smaller companies to create a search engine using the results, among other things.
By default PHP adds an “X-Powered-By” header which provides the PHP version. Since the common crawl data also provides header information I thought it would be interesting to see what the distribution of PHP versions in the wild looks like.
A caveat to this is that 1. it relies on the header information which may not be present on all PHP sites and can also be changed 2. It uses a subset of the common crawl data so the information may not be truly representative. 3. This is using the common crawl data from February 2016 so results may be out of date.
Which means these results are highly unscientific, however they may be interesting which is good enough for me.
First off what does the data look like? There are 4,202,648 URLS from 131,524 domains:
|URLS||Unique Domains||Powered By Provided||PHP domains|
We can see now that this is obviously just a tiny sliver of the internet at large.
This means that PHP is on 18% of the sites surveyed. Let’s dive into the versions:
|PHP Version||Count||Percentage of Total|
Some of this is very troubling. I really hope the sole install of “2.0” is just someone messing with the header information.
Even ignoring that however over 2 percent of installs are running (or at least claiming to run) PHP 4.4 whose end of life was almost 8 years ago.
12 percent of installs are running PHP 5.2 which went end of life 5 years ago.
38 percent of installs are for PHP 5.3 which went end of life 2 years ago.
Even the relatively more recent 5.4 has 25 percent of installs and it’s end of life was more than 7 months ago.
Even 5.5 which will reach end of life in a mere two months has 14 percent of installs.
All in all only 6 percent* of installs are receiving full support.
- Note that this only includes PHP installs which report their version via the X-Powered-By header. Site owners that disable this are probably more likely to keep their installs up to date so this likely artificially decreases the numbers.
There is some light at the end of the tunnel however. Ubuntu 16.04 has just been released which uses PHP 7.0 so hopefully these numbers will improve. Or it may just mean that in three years I’ll be updating this post with all the out of date PHP 7.0 installs. Watch this space to find out!