A major part of WordPress code is written in PHP. PHP version 7 was released in December 2016. This is such a significant release that PHP version 6 was skipped entirely. For non-technical folks (as well as those that are very technical) the major talking-point is that PHP 7 has been tested to run twice as fast as previous versions. As WordPress runs a significant amount of PHP code, this means that WordPress websites should load quicker with PHP 7.
The performance gains realized from PHP 7 are huge! They vary between 25% and 70% on real-world apps, and all of that just from upgrading PHP, without having to change a single line of code! Zend
I therefore decided to upgrade my PHP versions on my WordPress websites.
How to upgrade your WordPress PHP version
Updating to a newer version of PHP is incredibly simple if your host provides cPanel. Just follow the instructions below.
- Login to your host cPanel.
- Click the PHP Configuration button in the Software/Services section.
- Select the version of PHP you want to use from the options.
- Click the Update button to save your PHP configuration.
Depending on the version of cPanel your host provides, and how they have configured cPanel, the instructions may vary slightly. Also, some hosts don’t allow for changing the PHP version.
How I testing WordPress updated to PHP
I read alot of articles about the compatability of PHP 7 and WordPress and most people haven’t had issues. I was cautious however as WordPress software, plugins and themes use PHP extensively and therefore a PHP version change is significant.
I decided to change update to PHP version 7 for just one of my WordPress websites to ensure that all went o.k. I use StudioPress Genesis themes on all my websites and tend to use the similar plugins on all my websites (e.g. Gravity Forms with the Stripe and MailChimp addons, Jetpack, Mailgun, WP Super Cache, Yoast SEO etc.). I also use CloudFlare to optimize all my websites. A test on one website therefore will be a good general test of how my other websites should behave.
So, does WordPress work with PHP 7?
The first WordPress website I upgraded to PHP 7 had no problems that I noticed. I then decided to upgrade numerous of my other websites and I came across an issue on one of the Sites; the website with the Aspire Pro theme by StudioPress wasn’t loading the theme style.css file. I changed the PHP version back to PHP 5.6.20 and all appeared fine again (i.e. no display problems).
Since that issue I’ve decided to ‘downgrade’ all my PHP versions back to PHP 5.6.20. This is probably an over-reaction to an issue on one website however I’d rather be sure that my websites look good and function as they should. I use powerful virtual servers with cache preload so the speed advantages of PHP 7 will be negligible and most likely unnoticeable to my website visitors. I’ll try PHP 7 again in the near future.