Why update the PHP version of a site?
Companies must keep their PHP websites up to date to make them run faster. Outdated scripts often cause cyberattacks. What does a business owner have to know about updating the PHP version of a site? Read this article for more information.
What version of PHP should I upgrade my site to?
PHP is a server-side programming language on which 80% of Internet sites are based. Despite such popularity, not everyone knows it is necessary to update PHP versions regularly. Outdated scripts can affect the work of a site.
The most recent version of the language is PHP 8.1, released in November 2021. You should upgrade your site from an earlier PHP version to PHP 8.1. As for PHP 8.0, you can upgrade it later, in 2023. How do you understand when you need to update your site?
Language versions have their own “life cycle”: release—active support—minimal support —completion.
When a new version appears, websites start using it. Developers maintain and improve it for two years. They update the version and fix bugs and security flaws. Then they stop developing it because a new version is being prepared. IT specialists support it for one more year by fixing security vulnerabilities. To keep track of active versions and “dropout candidates”, see the information on the official php.net website.
Versions 7.0-7.3 and below are no longer supported and should be upgraded first. By the end of 2022, version 7.4 will have become obsolete. You can use version 8.0 until November 2023, and version 8.1 will be valid for two more years.
PHP 8.1 in a nutshell
On November 25, 2021, the latest version of PHP (8.1) was released. Its performance has improved by 5-8% thanks to the “inheritance cache” feature that caches links between classes.
The language has pleasant new options:
- enums (they represent a set of constant values);
- “green threads” to manage parallelism;
- unpacking an array with string keys;
- read-only mode;
- intersection types for all specified types;
- new never types;
- final class constants, and so on.
Developers have made some changes in syntax and added standard libraries and many other properties that only IT professionals understand. Let’s find out what these innovations mean for your site.
Why is it vital to update the PHP version of a website?
As of October 2022, 23.1% of websites are still running on PHP 5. Most web applications (71.2%) use version 7. And only 5.5% have migrated to the current version.
The WordPress.org site specifies PHP versions. Still, the proportion of sites that use currently supported versions is small. There are about 58% of them.
Owners of sites that run on older PHP versions are risking:
- They compromise website security.
As we have mentioned above, developers stop supporting site security three years after a release. This means that a site becomes vulnerable to DDoS, XSS, phishing, and other cyberattacks.
Hackers run automated scripts that scan millions of sites. This is how they look for vulnerabilities in web applications to break them with malware. Over 2,200 attacks occur every day.
Your site could fall into this sad statistic because developers won’t submit patches or fix security flaws in an unsupported version. Such a vulnerable site will crash, and customers will suffer. And it will take months to fix it.
- They deprive their sites of greater speed.
A new PHP version is better in terms of performance. For example, PHP 7.0 doubled the site loading speed compared to 5.6. Version 7.3 has another 20-25% performance compared to 7.0. 8.1 is also 5-8% faster than its predecessor.
Why do businesses need it? The faster web application pages load, the better a site ranks in the search engine. Good speed means a better customer experience and higher positions in Google.
- Support lasts for three years.
The release of a new version of the language has spurred the developer community into action, with many specialists supporting it. This includes fixing any bugs and security flaws. Specialists also guide how to best use the language’s features. However, when support ends, a site owner will have to deal with any problems themselves.
Why companies are reluctant to update their sites
If risks are great, why are companies reluctant to upgrade their sites to the latest PHP version? Here are the major reasons:
- Site owners do not know that they need to update a PHP version.
Businesspeople don’t understand the technical aspects of a website. They want a web application that looks good and works seamlessly. When it makes money and doesn’t break, why change anything?
- This issue is hard to detect.
Even when a site begins to “slow down” or produce errors, its owner does not realize that the cause of this is PHP. The web application does not signal that the language version needs to be updated. It is impossible to check the version of PHP on the site itself. To do this, you need to go to the hosting platform.
- Owners believe that this issue will not affect their business.
When a PHP version becomes obsolete, it does not mean that the site collapses on the day support ends. A month or two goes by with no obvious difficulties. Therefore, owners postpone updating their sites to the latest new PHP version for later.
But when someone hacks a site, it is too late. Especially if an application stores customers’ personal and banking information. It takes companies an average of 69 days and hundreds of thousands of dollars to deal with the aftermath of attacks. A site, sales, and reputation need to be restored. Why take the risk when you can “strengthen” your protection with a new version of PHP?
- Some hosting providers don’t remind their customers to update their PHP versions.
Hosting providers motivate businesspeople to upgrade their sites in different ways. Some of them set a mandatory condition: to upgrade to PHP 8.1 by a certain date. Other hosting companies warn about the desired upgrade. But they do not oblige business owners to do this and do not warn them about potential problems. Therefore, site owners do not consider changing a PHP version as a critical task.
- One needs developers to update their site to a new PHP version.
It is not possible to update a site on one’s own. There is no magic “Edit” button in a web application. Site owners require skilled developers who will update the PHP version on the hosting server.
If you don’t have a full-time IT specialist, seek outsourcing help from a company providing web development services. Such a firm has a specialist who will update your site to the latest PHP version. They will set up the plugins, conduct compatibility tests, and change the way they create the site.
Remember that you should update a language version every 2-3 years. Ask the outsourcing company for regular support of your site. Your technical partner will monitor PHP versions and schedule updates.
How to find out which version of PHP a website is running
You cannot see the PHP version on the site. To accomplish this, you need to:
— install a plugin to find the information (complicated option);
— visit the hosting platform and search for details there;
— ask the hosting provider.
When you see active support or security support is about to end, it’s time to plan a site upgrade.
Instructions on how to switch to the latest version of PHP
It can take a tech specialist several hours or days to update a PHP version, depending on the site’s age, the CMS, and the previous version of the language. The longer you put off an update, the harder it is to implement. Before upgrading, backup the database, user files, and the site itself. That way, if something goes wrong, you’ll be able to restore everything.
Since it is difficult for a non-programmer to update a PHP version, entrust this task to an IT partner—a company that provides PHP development services. With experienced developers and DevOps engineers, an update will be accurate.
First, you need to audit the existing version and assess how labor-intensive the work will be. Test all the functionality after the upgrade because the new PHP version does not support some features of the old one. If you ignore errors, your site may not work correctly, even if it looks fine at first glance. For example, some important business functions may not work, customers will see inaccurate information, or some form of order or feedback will not work.
Most organizations don’t upgrade their sites to the latest PHP version. By doing so, they deprive their sites of such competitive advantages as speed, performance, reliability, and better positions in Google. As a result, they are the first to be targeted by cyberattacks. Therefore, you need to update not only the PHP version but also the CMS application itself, and the framework, as there may also be security holes. Protect your business. Contact PHP developers to help you update your site.