It turns out PHP – probably something you’ve never touched if you’re not a full time website developer – needs to be updated by you. Updating your version of PHP will not only increase the security of your website, but speed it up as well. Learn how to update PHP.
What version of PHP is on your website?
While trying to solve some other issues, JetPack plugin support – which is awesome, by the way – let me know that they had discovered that my PHP was out of date. My websites were running on PHP 5.5.38, and should be on at least PHP 7.0.
Since I always keep my WordPress version, themes, and plugins up to date, I was shocked! How did this happen? So I did some reading.
What is PHP?
Here’s the two second summary. WordPress is written in PHP. PHP has to be translated into HTML to be displayed as webpages. The PHP that needs to be updated can be thought of as the PHP translator. It translates the PHP of WordPress into HTML so that browsers can read it and display it as webpages.
PHP rarely gets updated. But the update to PHP 7.0 significantly increased website speed, lowered energy use, and improved security. Everything a good website needs!
Why your PHP probably is an old version
The PHP that needs to be updated ISN’T a part of the WordPress files that get updated. It lives outside of your WordPress files, on the server of your webhost.
It’s up to your webhost to provide you with the different versions of PHP, but it’s up to you to switch to the updated versions. Unfortunately, website hosts almost never tell you this needs to be done.
There are many reasons that host don’t notify you that you need to update your PHP. Basically, they think any website developer should know they need to do this. But web hosts KNOW they are hosting a lot of non-professionals. The responsible thing, to improve internet security for everyone, would to be guiding us.
But, that’s probably not cost efficient.
In any case, now that you’ve found this tutorial, I’m going to show you:
- how to find out what version of PHP is running on your website
- how to pre-check to ensure that your WordPress website will be compatible to update to PHP 7.0
- how to update your PHP to 7.0, or to ask your host to do it for you.
How to update to PHP 7 on your website, increase your WordPress website speed and security
1. Always back up your site first!
Backup your site before going forward. Even if you check beforehand (step 2) and think your site is PHP 7 compatible, it may not be. So, BACK UP YOUR SITE.
- I backup using the free Updraft plugin to free storage on DropBox. You can also backup to external file storage. (If you want to set up your backups the same way and you don’t have Dropbox yet, if use this link to Dropbox ,we both get 500 megabytes of free extra bonus space! To get the free extra space, you must download Dropbox to your computer and verify your email address with Dropbox. You need to do that to be able to use Dropbox the way I’m going to show you anyway, so it’s not an extra step. They have a great tutorial to get you started. Also, when you sign up using that link, I get your email, but I won’t use it or sell it. If you want to get my newsletter, please sign up at the top of this page.)
- Make sure you have updated WordPress and all your plugins.
2. Check your plugins, themes, and WordPress version for PHP 7 compatibility.
I found this was super easy to with the free plugin PHP Compatibility Checker from WP Engine.
Note: I did see reviews that they were unable to uninstall the PHP Compatibility Checker. However, I didn’t have any problems.
There are some known false positives that may show up with some plugins such as Wordfence and Jetpack. Check false positives for PHP compatibilty on the PHP compatibility checker – compatibility page. (When I ran it, these listed incompatibility issues didn’t actually come up for me.)
- From your WordPress dashboard, install PHP Compatibility Checker
- To access the results.
- > Tools > PHP Compatibility
- Choose Scan option PHP 7.
- > scan site
I found that everything is compatible but I did find 6 warning, or cautions, on my WordPress framework Genesis (although it is compatible).
They looked like this:
618 | WARNING | Function name “__genesis_return_content_sidebar” is discouraged; PHP has reserved all method names with a double underscore prefix for future use
But they didn’t cause any problems with my update.
3. Where to update PHP used by your website
For many website hosts, you can do this from your cpanel. Cpanels are very familiar to WordPress developers. They are what they work from all day, every day. But if you are doing your website yourself, you may not have touched your cpanel since you first installed WordPress. CPanel basically your interface for working with your website host. I got pretty familiar with my cpanel when I moved webhosts and domain registrars.
But I still felt most comfortable calling my hosting support, at A2 hosting, before I went forward. Some hosts will update your PHP for you when you call. A2 support stayed on the line and walked me through every step. This is great for me learning how to do more with my own website.
4. Update PHP from your cpanel
Even if your host doesn’t have great support, you might be able to update your PHP from your cpanel on your own. Here’s how it works on A2 hosting,
- On the A2 Hosting website, Go to > Home
- Down on the right, to the right of your domain, > Login
- That will take you to your cpanel
- On your cpanel, you are looking for something that will let you select your PHP version. On my A2 cpanel , it’s under Software and it’s called Select PHP Version
- > Select PHP Version
- This will take you to the PHP selector.
- It will tell you what your current PHP version is. Write down what version PHP you are running, just in case things break and you need to revert back.
- Optimally, you want PHP 7.0 or higher.
- Click on the down arrow to see which versions of PHP are available on your server. (Apparently, even with the same host, different versions of PHP are available on different servers. A server is basically the computer where your website lives. Domain hosts have lots of different servers. I got lucky and PHP version 7.1 was available on my server. If PHP 7 or higher isn’t available on your website’s server, contact your host.)
- Select the most recent PHP version that you can, 7.0 or higher.
- > Set as current
- Check your websites to make sure they aren’t broken.
- If they break, go back to your cpanel and set the PHP version to what you had before. Contact your host and see if they can help.
5. Last steps to update PHP on your website.
- Click around and make sure everything looks okay. Just in case, keep the PHP version number you were running before handy.
- Remove the PHP Compatibility Checker plugin from your site. (Uninstall it.)
I wish I had run some site speed checkers before I did this, just to see the change. But at least it’s done and will improve my website security!
While you’re updating your website, be sure to see my tutorial about how to move your wordPress website from HTTP to HTTPS. Google will love you!
Learn more about PHP
4 questions I asked when upgrading PHP for my WordPress websites – Explains why you may be running an old version of PHP and you need to update it. It made me feel better to know that I wasn’t the only one clueless about PHP. I may have heard something long ago, but I think at the time, updating to PHP 7 was more difficult. I do think hosts should be telling their users about this.
Everything You Need to Know about PHP 7 – PHP is a programming language. Newer versions of PHP increase the speed of your website. However, after I finished this, there were still more things I needed to know about PHP and how to update it.
What is PHP 7 and How to Start Using it With WordPress? – Explains that PHP is what translates the WordPress code into HTML pages. That why it lives on the servers. PHP 7 also has some security enhancements. Also, eventually the older versions of PHP will not be supported. Before you update to PHP 7, you can use the plugin PHP Compatibility Checker to make sure all your plugins and themes are compatible with PHP 7. On most shared hosts, you can use your cpanel to update your PHP.
Why it matters what PHP version you are using. – I think it helped that I read the prior two articles before reading this one, but here I learned the danger of large shared hosting companies having old versions of PHP on their sites. They are so old that they are no longer supported, leaving website vulnerable to hackers. And the website owners have no clue. Thankfully, my PHP wasn’t that old!