Shawn McCabe
Author Shawn McCabe
Posted in Software Development , Drupal
July 7, 2016
Back to blog

Increase your Drupal 7 site speed with PHP 7

PHP has spent many years in the 5.x era, moving through point releases and incremental functionality changes. There was an attempt at a large unicode rewrite for PHP 6 that never got too far off the ground and we’ve just kept trucking along on PHP 5.

We’ve now skipped right past PHP 6 and on to PHP 7, which has focused almost exclusively on performance, with some very dramatic improvements. Many benchmarks have been touting a 2x speed increase, and some initial benchmarks on Drupal 8 and other PHP platforms have shown that to be true. What about Drupal 7 though? For lots of people a Drupal 8 upgrade is a long way off. PHP 7 is largely backwards compatible with PHP 5, so making Drupal 7 work on it is not out of the question. Just recently Drupal 7 achieved 100% passing test coverage on PHP 7 and I figured we should run it through some benchmarks to test performance.

Not technical? Click here to learn how faster websites make more money.


As you can see in the chart above, the improvements are even greater than expected, with average response times 2.5x quicker on a standard Drupal install and 3x quicker on a standard Drupal Commerce Kickstart install.

For the above benchmarks, I ran the following setup:

  • Stock Ubuntu 14.04 nginx setup on an AWS t2.small instance
  • Both setups are identical except for the PHP version.
  • I used Apache Bench for the tests, running 1000 requests at 10 concurrency


ab -n 1000 -c 10

I ran the tests multiple times to ensure consistent results and also ran them with different concurrency settings, which produced different times but the same ratio between PHP5 and PHP7.

Some cursory results also show it using about half the amount of memory, but I’d like to profile that a bit more accurately before I feel totally confident in those results.

Drupal 7 and Drupal Commerce 1.x are quite new to running on PHP7, so use them with caution, but with such drastic speed improvements, it seems very easily worth the risk.

Are interested in upgrading your site to PHP 7?

If you are interested in upgrading your Drupal 7 and/or Drupal Commerce 1.x site to PHP 7, contact Acro Media for assistance or download our PHP 7 Upgrade Information Sheet.

Download Our PHP 7 Upgrade Sheet

The Heartbleed Bug - What you need to know!

You may have heard of the "Heartbleed" security issue, which is affecting many sites across the internet, including enormous entities such as the ...
Keep Reading »

Why an Online Cloud & Web-Based POS System Beats a Traditional POS

The POS industry has changed over the last couple of years. Like most digital products and content, POS systems are moving toward cloud- and ...
Keep Reading »

Technical debt: Why it's bad and how to avoid it

Listen to the podcast   Listen to this post using the player, or subscribe using Spotify, Apple Podcasts, or Google Podcasts. Technical debt refers ...
Keep Reading »

Fields marked with * are required.