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

Drupal 8 Introduces Inline Editing… Finally

Drupal 7 had a lot of strengths, but editing was not one of them. It was embarrassingly terrible. You were more or less OK if you just wanted to ...
Keep Reading »

Making Drupal Code Standards Work for You With PhpStorm & phpcs/phpcbf

A proactive approach for cleaner Drupal coding So you are stuck in the cruft, struggling to create some semblance of sanity within a sea of code-rot. ...
Keep Reading »

The Drupal Community's Work With React

Acro Media’s own Josh Miller takes a minute to analyze how a Drupal community core initiative is solving for the JavaScript frontend framework React.
Keep Reading »

Fields marked with * are required.