Have you ever wondered what WordPress PHP version your website is using? Maybe you’re not even sure what PHP is or why it matters.
If you want a fast loading website that is as secure as possible, you’ll want to know what PHP is and how it’s used in WordPress.
More than that, you’ll want to know how to check which PHP version you’re using on your WordPress website so you can ensure you’re using the most up-to-date version.
In today’s post, we’re going to take a look at all of that and more.
So, if you’re new to PHP, start from the beginning. If not, or you’re just short on time, check out the table of contents and click on the topic you want to learn more about:
- What is PHP and How Does it Work?
- PHP Versions 5 vs 7
- Why Use PHP 7 on Your WordPress Website
- How is PHP Used in WordPress?
- How to Check and Update PHP in WordPress
What is PHP and How Does it Work?
PHP is an open-source, server-side programming and scripting language that is used to create dynamic (or always changing) websites. In simpler terms, PHP is the code that helps display your website to site visitors when they arrive.
When someone clicks on a webpage that has PHP code, like
your WordPress website does, the code is processed through your web host’s
servers, is turned into HTML, and is displayed on your site visitor’s computer
screen for them to see. And since this code is processed through your web host
first, before anything ever appears for site visitors clicking on your site, it
earns the label server-side.
There are several PHP versions you can use on your WordPress
website, but as with everything in the online world, it’s always recommended
you use the most updated of everything – including PHP.
The neat thing about PHP code is that your site visitors
never have to worry about it. All they have to do is click your site and let
their web browser do all the work. Even better is the fact that you don’t have to really worry about PHP
So long as you use the most recent WordPress PHP version
PHP Versions 5 vs 7
If you have any background knowledge about PHP, it’s likely you know that there are a few different versions available and even compatible on WordPress. In fact, according to W3Techs, 58.6% of all websites (WordPress or not) use PHP 5 and 40.9% use PHP 7.
The thing is, PHP versions don’t last forever. They go
through very distinct stages that include:
- Release of new version, complete with security
fixes and improvements
- 2 years’ worth of full and active support
- 1 year worth of support for critical security
- End of life and release of new version (no longer supported, even if still being
Right now, all PHP 5 versions are at the end of their lives. In other words, there is no support being given to any version of PHP 5.
And yet, a whopping 39% of WordPress website owners are still using some version of PHP 5.
But that’s not all. PHP 7 is playing out its lifecycle just like PHP 5.
In fact, PHP 7.0, which is being used by 14.8% of WordPress site owners, reached the end of its life early this year. Adding to that, PHP 7.1 is in the critical security fix stage of its life, and versions 7.2 and 7.3 are headed that way too.
While this may not seem like a big deal to you right now, trust us, it will. As new PHP versions are released and your version becomes outdated, you open your site up to a whole host of problems.
And the biggest shame about all of this is that updating to the most recent PHP version is not hard to do.
Why Use PHP 7 on Your WordPress Website
Okay, so you know that WordPress supports some PHP 5 versions. You also might realize that your web host supports PHP 5 too. So, if PHP 5 is still so widely used, why then make the switch to PHP 7?
Here are the benefits of updating your WordPress PHP version
to 7.1 or higher:
- Error handling like never before, so the same issues don’t recur over and again
- Consistent 64-bit support, so you can run your language on a Windows system
- WordPress.org advocates for PHP 7.3
- Improved developer features with less security holes and performance issues
Perhaps most compelling of all, and easiest to understand, is the fact that PHP 7 comes in at least 2x faster than PHP 5.
Don’t believe us? Check out this benchmarking study performed by Kinsta and see for yourself:
So, if you only take one thing away from this, know that
using the most recent version of PHP will make your site load blazing fast.
This means a better user experience, higher search rankings, and of course, increased
leads and sales.
How is PHP Used in WordPress?
If you download the most recent copy of WordPress from WordPress.org, and open the zip file, you’ll see that most of the core files are PHP.
The same can be said about most WordPress theme and plugin files
too. They are made up primarily of PHP files.
The fact that so many PHP files are baked right into the WordPress core, themes, and plugins, is a big reason why understanding what WordPress PHP version is and why it’s important is so crucial to your success.
Not to mention, a lot of WordPress’ flexibility (and thus popularity) comes from the fact that developers can use functions, hooks, classes, and methods inside PHP that can extend your website’s functionality in endless ways.
For example, here’s a few files that anyone using WordPress
will find within their site’s core that use PHP:
- comments.php files dictate how your comment section looks and functions
- header.php files determine how your site’s header looks and functions
- sidebar.php files decide how your sidebar area looks and functions
In the end, if you want your website to look and function in
a certain way for site visitors, it’s going to take all the PHP files working
together to deliver the correct HTML output for site visitors in their web
How to Check and Update PHP in WordPress
There are so many reasons why people don’t update their
WordPress PHP version:
- They don’t know or care about using PHP 7
- People rely on their web hosts to handle updates
(and this doesn’t always happen automatically)
- Developers find that updating core, theme, and plugin
PHP code is time-consuming and a pain
- Compatibility issues can crop up when updating, which
many people try to avoid at all costs
That said, you really should look into updating your PHP version.
Unless you’re an advanced developer working with tons of code on the backend of your site, checking your WordPress PHP version and updating it are really simple. Especially if you have a host that supports manual updates.
Step 1: Check Your WordPress PHP Version
The easiest way to see which version of PHP your website is
using is to go to Tools > Site Health in your WordPress dashboard. Then, click on
the Info tab.
Next, scroll down to the Server dropdown and see which PHP version your site is running.
If you see that you’re using an outdated PHP version, it’s
time to make a change.
Step 2: Make a Backup of Your Site
Before you jump in and update your WordPress PHP version on
your live site, make a backup of your
website. This way, should you run into the white screen of death, or some
other problem that requires you to restore your site, you can.
Make sure to include both site files and the database.
Here’s a list of the best WordPress backup
plugins to help you out.
Step 3: Set up a Local Site or Staging Environment
It’s always a good idea to make major changes to your website on a local site or in a staging environment before going live.
When you do this, you eliminate downtime. If something breaks, it doesn’t affect your live website and you have a chance to fix it without worry.
Step 4: Check For PHP Compatibility
Once you’ve ‘updated PHP’ on your local or staging site, it’s
time to check for compatibility issues. Again, this will ensure nothing breaks
when you do it for real on your live website.
To help with this, use the PHP Compatibility Checker plugin. Start by choosing which PHP version you want to test. You also have the option to test all plugins and themes, or just the ones that are active on your site.
Next, check out the compatibility results.
Once you know that your plugins and themes are compatible, it’s time to make the real update.
Just remember, any issues you run into on your local or staging site – and ultimately fix – will need fixing when you do it on your live site too. This step is just the practice stage to make sure you don’t break anything.
Step 5: Change WordPress PHP Version in cPanel
Most high-quality web hosts let you manually update your website’s PHP version in your hosting account. To do this, log into your cPanel (or similar) and find the section that lets you manage PHP versions.
Next, select the website you’re updating your PHP version
Now you’ll have the chance to choose the PHP version you want to use on your WordPress site.
If you’re really lucky, your web host will even give you the option to have PHP versions updated automatically for you. If you select this, make sure you’re monitoring your site, however, because this will skip the staging site phase and can cause issues on your site if there are any compatibility issues.
Of course, this is just one web host example. Your web host may differ slightly. So, check out this list of popular web hosts and step by step instructions for updating your PHP version.
And there you have it! You now know what PHP is, why it’s
important to use an updated version, and how to change your own WordPress site’s
PHP version in your hosting account.
If you haven’t quite set up your WordPress website yet, and are just toying with the idea of launching a site, be sure to check out our comprehensive guide to starting a WordPress website. And make sure when you sign up for web hosting that they hosting company you choose supports the most recent PHP version so your site loads fast and is super secure.
What PHP version are
you running on your WordPress website? Have you recently updated the PHP
version? We’d love to hear all about it in the comments below!
The post What is WordPress PHP Version and Why Does it Matter appeared first on WPHacks.
Rojenx is a leading concept artist who work appears in games and publications
Check out his personal gallery here