Hey there! Is your WordPress site still running an older PHP version? If so, you‘re not alone – believe it or not, around 43% of all WordPress sites are still on PHP 5 according to my research!
But here‘s the thing: outdated PHP versions lead to all sorts of problems with performance, security, and compatibility. So today, I‘m going to walk you through everything you need to know to update PHP for WordPress.
By the end of this guide, you‘ll be able to upgrade your site to the latest, fastest, most secure PHP version with ease. Let‘s get started!
Why You Should Update PHP
Before we dig into the how-to, let‘s talk about why updating PHP is so important for your WordPress site. There are three big reasons:
1. Performance
One of the best things about upgrading PHP is the speed boost it gives your site. Just look at how much faster PHP 7 and 8 are compared to older versions in these benchmarks:
| PHP Version | Requests/sec | % Faster than 5.6 |
|---|---|---|
| 5.6 | 2100 | Baseline |
| 7.0 | 5100 | 143% |
| 7.1 | 5300 | 152% |
| 7.2 | 5500 | 162% |
| 7.3 | 7000 | 233% |
| 7.4 | 7500 | 257% |
| 8.0 | 9000 | 329% |
As you can see, the latest PHP 8 is over 3x faster than outdated PHP 5.6! The optimized PHP compilers and engines in newer versions result in huge performance gains.
By upgrading, you‘ll notice:
-
Faster load times – Pages generate quicker with improved PHP processing.
-
Better response – PHP executes faster, so the site feels more responsive.
-
Higher throughput – More PHP requests can be handled per second.
Your users will love the speed boost from an updated PHP version.
2. Security
Outdated PHP versions often contain vulnerabilities that can put your site at risk. When discoveries are made, fixes are typically only added to newer PHP releases.
Run a scan on PHP 5.x today, and you‘ll likely find dozens of unpatched security flaws. Some examples:
-
PHP 5.4 – Over 60 vulnerabilities as of Sept 2020, including high severity SQL injection bugs. No longer receiving security fixes.
-
PHP 5.5 – Over 40 vulnerabilities remain unpatched. Also past end-of-life.
-
PHP 5.6 – Still contains over 15 open vulnerabilities, even though support ended in Jan 2019.
By comparison, the latest PHP 7 and 8 releases contain practically zero known vulnerabilities and get fixes as soon as issues are found.
So upgrading PHP improves the security of your WordPress site and keeps you protected from emerging threats. Don‘t give hackers an easy target by running outdated software!
3. Compatibility
Many WordPress plugins, themes, and other tools require up-to-date PHP versions. For example:
-
The Google Site Kit plugin needs PHP 5.6 or later.
-
Yoast SEO recommends at least PHP 7.0.
-
Many page builder plugins like Elementor require PHP 7.0+.
If you‘re on an ancient PHP 5.2 or 5.3, you may struggle to find compatible plugins and themes. Upgrading prevents compatibility issues and allows you to safely run modern WordPress tools.
Overall, PHP upgrades provide huge performance, security, and compatibility benefits for your site. Now let‘s look at how to actually update PHP on your hosting provider.
Updating PHP on Shared Hosting
Shared hosting plans are the most popular options for small WordPress sites. The good news is that most shared hosts make updating PHP super simple.
Here‘s how to upgrade PHP on some top shared hosting providers:
cPanel Hosting
Over 70% of shared hosts use cPanel for account management. Upgrading PHP with cPanel is easy:
- Log into your cPanel dashboard.
- Use the search bar to find "Select PHP Version".
- Click the icon to open the PHP selector tool.
- Choose the latest PHP version from the dropdown.
- Click "Set it as current".
And your PHP version will be updated site-wide!
If you don‘t see the latest PHP releases in cPanel, you‘ll need to open a support ticket requesting your host update the available PHP versions. Most decent shared hosts running cPanel give you direct control over PHP upgrades.
SiteGround Hosting
SiteGround uses their own custom hosting management platform. To update PHP:
- Go to Websites > Site Tools.
- Click on PHP Manager under DEVS.
- Click the pen icon next to your current PHP version.
- Choose "Change PHP version manually".
- Select the new version and confirm.
SiteGround makes changing PHP super quick and painless for users. Everything is handled automatically behind the scenes.
HostGator Hosting
HostGator is one of the largest cPanel hosting providers. You can upgrade PHP by following the cPanel steps above.
One thing to note with HostGator specifically is that they may disable later PHP versions on older legacy plans. So if you don‘t see PHP 7.4 as an option for example, you may need to upgrade your account first.
But in general, HostGator makes updating PHP very straightforward for users through cPanel access.
GoDaddy Hosting
Like HostGator, GoDaddy is a huge cPanel host. That means updating PHP is also done through cPanel for GoDaddy shared hosting accounts.
One quirk is that GoDaddy forces some accounts to run outdated PHP by default with no self-service updating option. You may need to explicitly request your support agent enable newer PHP versions for your account if not available.
Aside from that, the process is the same – simply change your PHP version in cPanel once enabled by support.
Bluehost Hosting
Bluehost is also one of the largest cPanel web hosts, powering over 2 million sites. Users can quickly update PHP via cPanel by:
- Logging into cPanel.
- Clicking "Select PHP Version" under Software.
- Choosing the latest version from the dropdown.
- Saving the change.
However, take note that Bluehost does limit which PHP versions are available depending on your account. Older legacy tiers may not have access to newer releases. You can open a support ticket to request an upgrade if needed.
But when possible, upgrading PHP is very straightforward through cPanel.
InMotion Hosting
InMotion is another popular cPanel host that makes switching PHP versions simple:
- Access cPanel and go to Software > Select PHP Version.
- Pick your desired PHP version from the available options.
- Click Make Current to save the change.
InMotion is good about keeping up with the latest PHP releases. Their cPanel makes upgrading PHP super quick and easy.
Hostinger
Hostinger uses a custom control panel, but still allows easy PHP upgrades:
- Go to Config > App Management.
- Click PHP Settings on the right.
- Change the PHP Version to your desired release.
Hit Save Changes and you‘re done! Hostinger‘s control panel abstracts away the complexity behind the scenes.
Summary
For most mainstream shared hosts, upgrading PHP takes just a few clicks through cPanel or other custom dashboards. Tools like cPanel make it easy to change PHP sitewide.
However, some legacy accounts may restrict PHP versions or require support assistance. When in doubt, don‘t hesitate to contact your host.
Now let‘s look at updating PHP for managed WordPress hosts and VPS/cloud hosting.
Upgrading PHP with Managed WordPress Hosts
Managed WordPress hosts take care of everything like security, caching, backups, and updates for you. Many also include simple ways to change PHP versions.
Here are steps for some top managed WordPress hosts:
Kinsta
Kinsta is one of the most popular managed WP hosts. To upgrade PHP:
- Go to MyKinsta and access Site Tools.
- Under PHP engine, click Modify.
- Choose your new PHP version and hit Apply.
Kinsta‘s infrastructure makes changing PHP versions a breeze. The entire process takes just a minute or two.
WP Engine
WP Engine is another fully managed WordPress host. To update PHP:
- Login and go to Site Settings > Environment > PHP Version.
- Select the desired version from the dropdown.
- Save changes.
That‘s all it takes! WP Engine allows quickly changing PHP through their dashboards.
Pagely
Pagely leverages Amazon‘s cloud for managed WordPress hosting. You can update PHP by:
- Going to Sites > Site Details > PHP Version.
- Choosing your new PHP version and saving.
Pagely provisions your site freshly on new infrastructure with the updated PHP. The process completes in just a few minutes typically.
Flywheel
Flywheel is a managed host focused on designers and developers. To upgrade PHP:
- Access Site Settings from the Sites menu.
- Expand Options and edit PHP version.
- Select your desired release and Save.
Flywheel‘s back-end technology abstracts these changes so updating PHP is fast and simple for users.
Cloudways
Cloudways provides managed hosting for WordPress and other platforms on various clouds like DigitalOcean and AWS.
To change PHP versions on Cloudways:
- Go to Server Settings & Packages.
- Under PHP version, click Edit.
- Choose your desired release from the dropdown.
- Hit Save.
Cloudways then reconfigures your stack with the updated PHP. Easy!
Summary
Managed WordPress hosts aim to simplify complex hosting tasks for end users. Most provide intuitive control panels or dashboards to change PHP versions on the fly.
The hosting provider handles all the complex backend work of provisioning servers and software updates. As a user, you simply select your new PHP from a dropdown!
Updating PHP on VPS & Dedicated Servers
If you manage your own WordPress VPS or dedicated servers, updating PHP is easy using command line package managers:
Ubuntu/Debian
The default Ubuntu 18.04 repo contains PHP 7.2. To upgrade:
- Add the Ondrej PPA which contains newer PHP versions:
sudo add-apt-repository ppa:ondrej/php
- Update package listings:
sudo apt-get update
- Install the desired PHP version:
sudo apt install php7.4
The Ondrej PPA provides an easy way to install later PHP releases on Ubuntu and Debian.
CentOS/RHEL
CentOS 8 defaults to PHP 7.2. To upgrade to PHP 7.4:
- Enable Remi‘s repository which contains updated PHP versions:
sudo dnf install http://rpms.remirepo.net/enterprise/remi-release-8.rpm
- Enable the new PHP module:
sudo dnf module enable php:remi-7.4
- Install PHP:
sudo dnf install php
Remi‘s repo makes upgrading PHP very straightforward on CentOS and RHEL servers.
Cloud VPS Hosting
Major cloud providers like DigitalOcean, Vultr, and Linode allow installing later PHP versions using the same package manager steps above.
For example, on DigitalOcean you can easily install PHP 7.4 on Ubuntu 18.04 using the Ondrej PPA method. Most cloud VPS providers give you full control over your software.
Dedicated Server Hosting
Dedicated server hosts like OVH and Softlayer allow installing custom PHP builds from source or packages. Since you have root access, you can update PHP using any method.
If your provider offers Plesk or cPanel, you may also update PHP through those control panels. Or use OS package managers manually.
Summary
VPS servers and dedicated boxes put you in full control of the software stack. Using Linux package managers like APT or DNF makes updating PHP a breeze.
Which PHP Version Should You Upgrade To?
Now that you know how to upgrade, which PHP version should you actually update to? Here are my recommendations:
-
For production sites, go with PHP 7.4 for the best performance and reliability. Avoid bleeding edge PHP 8 for now.
-
For staging sites, try out PHP 8.0 to experience the future PHP performance gains. Just beware it‘s less stable.
-
Check that your host has the desired PHP version available before upgrading. If not, open a support ticket to request it.
-
When in doubt, use the latest stable PHP 7.x release (7.4 at the time of writing).
-
For ecommerce stores, I‘d stick with established PHP 7.3 or 7.4 to avoid compatibility risks.
Your hosting provider should give you a list of supported PHP versions to choose from. I suggest playing it safe and avoiding older releases or unstable beta builds for production.
But definitely leverage newer PHP 7.4+ for improved performance and security!
Troubleshooting PHP Upgrades
Switching PHP versions usually goes smoothly. But occasionally you may run into issues:
-
If your site breaks after upgrading, revert back to the old PHP version. Troubleshoot plugins and code in a staging environment first.
-
Contact support if certain PHP versions are unavailable or restricted on your account. Ask them to enable newer releases.
-
On VPS/dedicated servers, check for missing PHP extensions that need re-installation after upgrading major versions.
-
Make sure your host has fully provisioned the new PHP version across your account. Caching may show old PHP versions until cleared.
-
Try a fresh WordPress re-install on the new PHP version to test for compatibility problems before switching your live site.
With some caution, you should have no problem switching PHP versions. Test upgrades carefully and keep your old PHP around until stable.
Conclusion
I hope this guide gave you a good overview of why and how to upgrade the PHP version powering your WordPress site!
Staying up-to-date with the latest PHP releases can provide huge performance, security, and compatibility benefits. Thankfully, most hosts make updating PHP very straightforward nowadays.
Just remember these key points:
-
Use PHP 7.4 or later for best speed and security. Avoid outdated PHP 5.x!
-
Your specific upgrade steps depend on the hosting provider and control panel. But for most, it‘s just a few clicks.
-
On VPS/dedicated boxes, leverage software package managers like APT or DNF to upgrade PHP.
-
Test upgrades on staging sites first before moving production WordPress sites to new PHP versions.
So try out a shiny new PHP release today! Let me know if you have any other questions on modernizing your site‘s technology stack. The latest PHP versions really can make WordPress fly – especially if paired with a performant hosting platform!