Read

PHP8: Why Upgrade? When Should You Do It – And How?

PHP is one of the most popular programming languages today. So popular, in fact, that it’s estimated that nearly 78% of all websites are running on PHP. So there’s a good chance that yours is, too.

The big question is… what version are you using?

In 2020, the latest major update – PHP 8.0 – was released. However, two years have passed and it’s reported that fewer than 7% of WordPress sites are running on PHP8. So should you be upgrading?

Yes.

Despite the low adoption rate, it is absolutely worth updating your WordPress site to PHP 8. But why should you do it? When should you do it? And how can it be done? We’ll answer all three below!

Why upgrade to PHP 8?

The most obvious reason to update your site – or your clients’ sites – to PHP8 is performance. PHP8 promises a much-improved performance from previous versions, helping sites to run much faster. Research suggests that PHP 8.0 is capable of handling 111.10 requests per second, compared to the 106.56 req/sec of PHP 7.2. PHP 8.1 is even better, capable of handling 163.43 requests per second.

Beyond speed, there’s also the benefit of being able to take advantage of the latest developments and technologies. PHP8 comes with a range of new features that could help your site to meet its goals more easily. There’s better error handling for internal issues in this version, for example. And there are some additional technical code benefits for anyone that’s writing their own plugins.

Finally, it’s important to consider long-term support. When upgrading to PHP8, you have complete peace of mind that you’ll have the support you need until 2023 at the earliest. PHP 8.0, which was launched in November 2020, will have full support until November 2022, and security support until November 2023. The more recent version, PHP 8.1 which was released in November 2021, will have full support until November 2023. It will also offer security support until at least November 2024.

When is the best time to upgrade?

As soon as possible! The last version to be released before PHP8 was PHP 7.4, which was introduced in 2019. Full support for PHP 7.4 has already ceased, ending in November 2021. And while security support is still available, this is due to end on 28th November this year, so there’s not very long left.

When security support for PHP 7.4 comes to an end, sites that are running on these unsupported versions will be leaving themselves vulnerable to attack. By upgrading as soon as possible, you can ensure you’re taking critical steps towards keeping your site, or your clients’ sites, safe and secure.

How to upgrade to PHP8

Here are our top tips for upgrading to PHP8…

  • Don’t make changes directly on your production site, just in case anything goes wrong. Instead, create a copy of your website, known as a staging site. You may already have one you can use.
  • Ask your server administrators – this may be someone in-house, or your hosting provider – to switch over from the current version of PHP that you’re using. They will be able to shift you over to PHP8.
  • Test and fix. Test your site and look for anything that may have become broken in the changeover process. Make any necessary changes, and always ensure you perform another full test of the site.
  • Plan a maintenance window for your production server. During this time, you can upgrade this server to PHP8 and deploy any changes you made. Do this separately from any content updates.
  • Bring your site back up and running! It’s always worth having a quick check through the live site as it comes back up. This gives you peace of mind that the website is working as you expect it to.

No time? No problem! At Freestyle Internet, we can handle all aspects of your upgrade for you, ensuring your site is always running on a secure, supported, high-performance version of PHP. Contact us for more information about how we can help, or schedule a call with Chris.