Wednesday, May 18th, 2022

How to Update PHP in WordPress (Kinsta, DreamHost, & cPanel)

There is a lot of advice out there about keeping your WordPress themes, plugins and core files up to date. It helps to keep your site in working order. However, it’s not the only element to focus on. You will also want to update the PHP in WordPress to keep it running smoothly server-side.

Every site has a front end and a back end. The back end ensures that your site loads quickly, performs well, and keeps malicious users away. Your PHP version must be current, your site’s files must be there for several reasons.

In this post, we will give you an overview of how WordPress and PHP interact. From there, we’ll show you how to update your PHP in WordPress.

How WordPress uses PHP to serve websites

Before we get into the larger part of the article, let’s discuss PHP itself. Websites run on a ‘stack’ for the unknown. It is a collection of software that helps in running the site. For example, WordPress runs using a few different tools and languages:

  • front end: HTML, CSS.
  • Interactivity: Javascript, React.
  • Back End: PHP.
  • Server: My SQL.

While we are not going to go into the details of everything here in this post, know that PHP is vital to the functionality of WordPress. It is a ‘server-side’ programming language that makes websites dynamic.

Take the contact form. The ability to send the information involved to a server and store it in a database is critical to basic operations. Not possible without PHP as part of the WordPress stack.

Why You Should Update Your PHP Version in WordPress

Considering how WordPress uses PHP – it’s built-in to its operation – there are a lot of benefits to keeping the PHP version up to date on your servers. Many of them are here just as they are for other site elements:

  • You can take advantage of new developments in the language.
  • The new version often has better performance.
  • Security issues found in previous versions will often be patched, making your site stronger and more secure.

For a real world example, take PHP 8. It is the latest version of PHP, and has been adopted by many major web hosts for a few reasons:

  • PHP 8 has tightened its error reporting, helping developers maintain better code.
  • There are new performance features, such as ‘Just in Time’ (JIT) processing. This can be compared to caching, in that PHP tracks frequently used scripts and optimizes them.

There are many other benefits, but they are beyond the scope of this article. Still, there are some situations that don’t require an immediate upgrade. Let us discuss this further.

When should you update your PHP version

As with standard advice for anything related to your site, updating depends on a few variables. In most cases involving your themes, plugins, and core files, you will update as soon as you are able.

Conversely, your PHP version may not warrant an instant upgrade. In many cases, there are more drawbacks than positives. Here’s something:

  • Some functions are deprecated in PHP 8, but are still used in a lot of WordPress plugins. As such, upgrading can break those (and by extension, your site). In other words, your site and its dependencies may not be compatible with the update.
  • You may find that you do not need the advanced functionality of the newer PHP version.
  • For security and stability reasons, your host may not yet support the newer version of PHP.

Then, there are many more reasons that are specific to your own and your host’s needs. In general, unless there is a major Spotlight reason not to upgrade, you should do so.

What’s more, plenty of hosts will tell you how to upgrade when the time is right. They should all have a blog, newsletter, knowledge base article, and more detailing whether the upgrade is possible, and how to do it.

How to Check Your Current PHP Version

First, you need to check your current version of PHP before upgrading it. Achieving this depends on your host and current plan. Most custom dashboards will have a specific panel dedicated to PHP management. For example, Kinsta (our review) adds it to your list of sites:

Current PHP version within Kinsta.

In contrast, DreamHost gives you information after navigating a few subscreens:

Current PHP version in DreamHost.

For cPanel users, your current PHP version can be found at MultiPHP Manager:

MultiPHP Manager setting in cPanel.

Whatever your host, it should almost always display the current version of PHP used on your site. You may also find that you are running the latest version of PHP anyway.

A lot of hosts will automate this with your permission, such as confirmation via newsletter, or a dedicated toggle within your control panel.

It may also happen that you No Have yet to update PHP in WordPress. This is often because the host wants to test functionality first before deploying it to the public. In these cases, you don’t have much to do. Your host will handle the process, and you can sit back.

It’s fair to say that this article is less relevant if you’re on a managed WordPress host. Still, the process is worth knowing because you may want to update PHP in WordPress for reasons specific to you.

What You Need Before Updating Your PHP Version

The good news is that because updating PHP in WordPress is straightforward, you won’t need much to get the job done. In fact, there are a few elements you’ll need:

  • Administrator access to your server.
  • Ability to upgrade your PHP version within your hosting panel.

In addition, there are some preventive measures you can take before continuing with the update:

  • Make a current, clean backup of your site – in case the worst happens and you’ll have to start over.
  • Update the core files of your WordPress site.
  • Update your site’s themes and plugins.
  • Check compatibility once again.

Once set up, you are ready. The next section will show you how to update PHP in WordPress.

How to Update PHP in WordPress

In the next few sections, we will show you how to update PHP in WordPress via different host types. Instead of covering individual hosts, we’ll show you how to get the job done in two separate custom dashboards and cPanel. This should include all the bases you will find. They are here:

  • Kinsta. In about three clicks, you can update PHP in WordPress and go about your day.
  • DreamHost. While there are a few steps to go through here, changing your PHP version is straightforward.
  • cPanel While the option to replace PHP is somewhat suppressed, cPanel is as easy to use as other hosts.

To begin, let’s show you how to update PHP in WordPress using Kinsta.

1. Kinsta

We’re going to start with the MyKinsta dashboard for this. the screen you have to go to is sites:

Kinsta's Sites screen.

From here, click on Your site, and you’ll be presented with a ton of information and options for your site:

Kinsta's info panel.

However, here we want to go Device Screen. It’s a bunch of ways to change certain aspects of your server. In our case, it is PHP Engine:

PHP Engine Options in Kinsta.

click here Revised drop-down menu, and choose the PHP version you want. This will bring up a dialog box asking for confirmation:

Modifying PHP version.

Once you confirm, Kinsta will process the change on the back end, and send you a notification when it’s finished.

2. DreamHost

For DreamHost’s custom dashboard, you need to access Domains > Websites Screen:

DreamHost's Control Panel.

It will show you a list of your current sites, and clicking on the traffic light menu will bring up a whole host of options. would you like to choose PHP Version:

PHP version option within DreamHost.

The screen that pops up is where you checked the current version of your site earlier. This time, select your new PHP version from the drop-down menu and click change php version:

Choosing a new PHP version within DreamHost.

Unlike Kinsta, you will get a ‘soft’ warning. This means that you will have to see a change in the color of the confirmation button – here it is red:

Confirming the change of PHP version in DreamHost.

Once confirmed, DreamHost will do its job.

3. cPanel

For cPanel, the process of updating your PHP is still straightforward. However, this is a ‘vulgar’ way of making changes. First, you have to go back MultiPHP Manager In your cPanel dashboard:

MultiPHP Manager option on the main screen of cPanel.

From here, check the boxes next to the sites you want to change, then take a look at the drop-down on the right:

Selecting a new PHP version within cPanel.

It lets you choose another PHP version. Once you are ready, click To apply, and cPanel will do the necessary work. Although cPanel is a general dashboard for managing your site, some hosts may also provide custom functionality to update PHP in WordPress.

Therefore, we recommend that you talk to your host to find out if there is a process to make the update even faster.

Summary

Updating PHP in WordPress is a task that is not always required. In fact, a lot of hosts automate the process, and take the work out of your hands. Still, you may want to do manual updates occasionally.

The good news is that the process is simple regardless of your hosting provider. If you can find your PHP version number within your host, there is often a drop-down to upgrade. If not, your host can point you to the correct location in their control panel.

Are you considering updating your PHP version in WordPress, and if so, why? Let us know in the comments section below!

Source link