In this guide, we explain why it is necessary to update PHP, what the benefits are, and how you can prepare your site for the update.
- What is PHP?
- What is the lifecycle of PHP?
- How will my website be affected when PHP is updated?
- What are the benefits of updating?
- How does One.com handle an "End of life" of a PHP version?
- How can I prepare my site for a PHP update?
- Where can I change my PHP version?
What is PHP?
PHP is an open-source programming language that runs on a webserver. It is one of the most popular languages for web development; for example, all WordPress sites run on PHP.
PHP is a server-side script, meaning that it is executed on the webserver, contrary to HTML, which is executed in the browser. By combining PHP with HTML, you can create dynamic websites, for example, sites built with WordPress, Joomla and Drupal.
What is the lifecycle of PHP?
All PHP versions have a lifecycle of about three years, after which they are no longer supported.
After the initial release, a PHP version is actively supported for approximately two years. After that time, there will be 1-2 years of security support, meaning that there are only releases for critical security issues. During this phase, the next PHP version is already available.
When a PHP version reaches end-of-life, it does not get updated anymore, so after that time it's no longer secure to use it. You can check the PHP website to see which versions are currently supported.
How will my website be affected when PHP is updated?
That depends on how you've built your website. If your site is created with HTML, like Website Builder, then the PHP update has no effect at all.
If your site is created with PHP and the code is compatible with the new PHP version, your website will function the same or better. If you use a CMS like WordPress, you can probably notice some improvements in performance, provided you have updated WordPress to the latest version.
If you use code that is outdated and not supported in the newer version of PHP, then your site will give errors and may stop working altogether. For example, if you haven't updated your CMS to the latest version, or if your website uses custom code, for which an update isn't readily available. In that case, you need to update the code to make it compatible.
Note: If you suspect that your site contains outdated code, it's very important that you take the time to update your site, before older PHP versions are removed from our servers. It's easier to fix things, if your site is still working, and you are able to switch between older PHP versions.
What are the benefits of updating?
- Better security - The most obvious reason to update is security. Newer versions are better at countering hackers, for example, because deprecated (outdated) code is no longer supported.
- Faster websites - Newer PHP versions are faster. On average, sites using PHP 7.3 run 9% faster than sites using PHP 7.2.
- New features and improvements - As with all updates, a newer version includes new features and improvements on how to do things, for example, error handling.
How does One.com handle the "End of life" of a PHP version?
- First, we inform all customers who still use this version, that support is about to end and advise them to update as soon as possible.
- Next, we update PHP automatically for all customers. We do this approximately one month before the PHP version is removed from our servers. That way, you are made aware of any possible issues that require your attention, while it is still possible to go back to the old version. This should give you enough time to fix things.
- Finally, we update PHP again for those sites that changed it back and at the same time, we remove the unsupported version from our servers. From then on, it is not possible to go back and the PHP version is no longer available as an option in the control panel.
Note: If you notice errors on your website after the first time PHP gets updated, this means that some code is not compatible. We recommend that you fix it as soon as possible.
What can I do to prepare my website?
Since a PHP update is unavoidable, it's a good idea to be a pro-active and make sure your site is ready.
- Make sure that you have updated your website to the latest version.
- Remove plugins, themes or old installations that you don't use.
- Change the PHP version from the control panel, at a time of your convenience, and check if everything is working.
- Fix any errors that occur. You can either do it yourself or find a developer who can help you.
Do you have a WordPress site? Then check our dedicated guide: How do I update PHP for my WordPress site?
Tip: We recommend changing PHP to "the latest stable version", check our guide for more information: What is the latest stable PHP version?
Where can I change my PHP version?
You can easily change your PHP version from the One.com control panel.
- Log into the One.com control panel.
- Click on the Advanced settings tile and then select PHP and database settings.
- Scroll down to Update PHP version.
- Select the version you want to use and click Update.
Note: It takes 20 minutes before the update is in effect. If you have a website with a lot of visitors, it may take a couple of hours.