How to Update PHP on My WordPress Site

Posted on |


If you host a website, your speed and security are only as good as your PHP version. 

The problem? For the average WordPress seller or blogger, updating your PHP sounds a tad like getting into the weeds. 

You created a website so you could sell homemade candles or blog about reality TV—now someone is telling you to learn programming languages? Yeah, right. You might not fully understand what it does, and you certainly don’t spend most of your day thinking about it. 

But it’s important—and updating it can be easier than you think. 

With that in mind, let’s explore why—and how—you should update your PHP to keep your WordPress site up to date.

What is the WordPress PHP (and why bother updating it)?

PHP is a slightly-confusing acronym for hypertext preprocessor. In short, it’s an open-source scripting language forming the core of what makes WordPress work. It encrypts data for better security. It also forms the infrastructure for posting your dynamic blog content through the WordPress CMS

Think of it as the tracks that keep your WordPress site’s train gliding smoothly.

Like WordPress itself, PHP has versions. These versions evolve with the web, adding features to keep your site secure.

Why bother updating it? For starters, newer PHP versions make your site faster and boost performance. According to Kinsta, for example, the leap from PHP version 5.6 to 7.0 doubled website performance. 

But you also have to keep up with your hosting plan. Here at HostGator, we removed versions 5.2 and 5.3 from the Shared and Reseller hosting plans back in August. 

PHP versions go up to 8 now, although versions 7.3 and 7.4 are still popular. Which version should you use? Well, if you’re reading this, there’s a decent chance you already need an upgrade. At the very least, version 7.3 will keep your site in line with the current requirements at HostGator.

The good news is that updating your PHP is much easier than it might sound. Here are the specific steps.

How to diagnose your PHP within WordPress

There are multiple options for updating your PHP, and you’ll see them below. But we’ll start with running directly through WordPress because it has one key advantage: you can check your PHP version at a glance.

To diagnose your PHP version first, do the following:

  • Within WordPress, go to Tools > Site Health
  • When you click Server, you should see a row that lists the current status of your server’s PHP version. 

If you don’t see the version you want yet, you know it’s time to move to the next step. 

How to update your WordPress PHP in HostGator

If you’re using HostGator, you can navigate to your cPanel and use the MultiPHP Manager to modify your PHP version. Previously, HostGator included PHP Selector as one method. But since we’re slowly phasing that out, we’ll focus on the MultiPHP Manager method below.

  • Log in to your cPanel.
  • Go to the Quick Functions search bar and type in multi. This will bring up MultiPHP Manager easily. Click on it.
  • Scroll down and select the relevant domain.
  • Scroll up to the PHP version, click the version you want to use, and click Apply
  • Look for a “Successfully applied PHP version…” notification. 
  • If you created a phpinfo file in the steps below, refresh that page to see if the changes have taken effect.

If you think you’ll update your PHP version as often as you can, you might also consider creating a phpinfo file within HostGator to double-check that your conversion is successful—or simply to remind yourself which version you’re using. 

Note: If you already know your PHP version, skip to How to update your WordPress PHP below. Otherwise, you’re just going to get frustrated with a lot of meaningless steps. 

However, if you’re unsure about your PHP version, having a phpinfo.php file in place can help you diagnose it at any future date with just a glance.

  • Log in to your cPanel.
  • Go to Software
  • You’ll see selections like WordPress Manager and Perl Modules. You’ll want to scroll down until you see MultiPHP Manager and select it. From there, you can follow along with this handy video

We’ll also include those steps here:

  • In your HostGator cPanel, scroll down to File Manager and click.
  • This takes you to your home directory. If you’re working under public_html, scroll down to find that folder and double-click.
  • Click +File. Name your file phpinfo.php and click create new file.

Now you can copy and paste one of the code options from our guide to phpinfo files. Here’s the code to show all PHP information:

#Use the following code to see the installed modules and their current values.

<?php

phpinfo(INFO_MODULES); // This would be used to display the installed modules and their current values.

?>

  • Under your Hostgator cPanel, right-click phpinfo.php and click edit.
  • Paste the information. Click Save Changes.

Now view your phpinfo.php page in your browser. If you saved the file under public_html, you can simply enter www.your-domain-here.com/phpinfo.php. Look for the version of the php at the top—you now know what you’re running.

It only takes a few moments, but updating your WordPress site’s PHP can instantly boost performance, speed, and security. Given the demands of today’s top search engines, it always pays to be up-to-date. The good news? If you do it right, it only takes a few minutes to stay that way.

Want an easy way to keep your website up to date? 

Consider managed WordPress hosting from HostGator for affordable, simple-to-manage hosting on your site.

Casey is the Senior Director of Marketing for Hosting and has been in the web hosting space for 7 years. He loves the slopes and hanging out with his kids.

Leave a Reply

Your email address will not be published.