PHP is a server-side programming language that can be used to create advanced websites that perform actions that are not possible with a plain HTML site. Some features, enabled by PHP, include the ability to send email messages through your website, display different content depending on the person visiting the site, and even perform arbitrary server-side computations like image processing and PDF document generation.
Like most other programming languages, new versions of the PHP language are released over time. These new versions often fix bugs and introduce new functionality that web developers can take advantage of. In this article, we will show you how to update the PHP version that is used on your hosting account.
Which PHP Version Should I Use?
Conventional wisdom holds that you should be using the latest available version of PHP, as it will offer the newest features and incorporate the highest number of bug fixes. There is just one other factor you should take into account – whether or not you are using a third-party Content Management System (CMS).
If you are not using a CMS and instead you have coded your own PHP website, you can safely try running the latest version of PHP. And if any errors occur, you can always downgrade back to your previous PHP version.
If, on the other hand, you are using a CMS such as WordPress, Joomla, or OpenCart, you should refrain from always running the latest version of PHP. The reason for this is that the CMS developers might not have had enough time to ensure full compatibility with the latest version of PHP. Instead, we suggest checking the CMS developer’s website for information on what is the optimal version of PHP to use with their CMS.
How Do I Update My PHP Version?
The actual process of changing your PHP version is very straightforward. Follow the steps below in order to update the PHP version that is used on your hosting account:
- Open the PHP Settings section of the Control Panel.
- In case you are using one of our premium hosting plans and you have made customizations to your PHP installation through your global php.ini file, you should back up the contents of the php.ini file. Not sure how to make a copy of your php.ini file contents? You can read our article on how to customize your PHP settings. If you have not made any modifications to your php.ini file, you can skip this step.
- You will notice a dropdown menu with different PHP versions, as shown in the screenshot below. Use this dropdown menu to select the version of PHP that you would like to use and then confirm your choice by clicking on the Switch button.
- A popup dialog box will appear asking you to confirm the PHP version change. Click OK to update your PHP version.
The System Administrator team works hard to ensure that the newest versions of PHP are available across our entire shared hosting platform. Thanks to their efforts, you can take advantage of the latest publicly available PHP versions regardless of the hosting plan you are using, be it our free hosting plan or one of our premium shared hosting packages.
Can I Set PHP Versions Per-Site Instead of Globally?
Currently, it is not possible to set a different PHP version for each website that you are hosting on your account. Our recommendation is to find a PHP version that works for all of your websites and use it. As an alternative, you may consider purchasing a Virtual Private Server package. A VPS grants you full root access to your hosting environment, empowering you to implement any customization that is needed, including the ability to set per-website PHP versions.
How Can I Switch to a PHP Version That Is Not Listed in the PHP Settings Panel?
Most Content Management Systems list a specific PHP version or a PHP version range as being optimal for the operation of the CMS. But what happens if the recommended PHP version is not present in the PHP version dropdown menu?
If you don’t find the PHP version that you need for your website software to work as properly, you can take several actions, depending on the PHP version that is missing:
- If you don’t see the newest version of PHP listed in the dropdown, you can contact the Technical Support Team and request the latest version of PHP to be added. If the PHP version that you are interested in is actually pre-release (beta) software, it is best to wait for the official release before contacting the Support Team.
- If your site requires an older version of PHP, that is no longer shown in the PHP version dropdown menu, your best bet is to update your website software since a newer version of the software will likely support more recent versions of PHP. Contact the developer of your CMS and ask whether an updated version of the CMS is available for download. Your other option is to purchase a VPS cloud hosting plan where you will be able to install any PHP version that is required by your CMS to run properly.
Why Are Some PHP Versions Marked as Obsolete?
Speaking of old versions of PHP, you may have noticed that some entries in the PHP version dropdown menu are marked as obsolete. You can refer to the screenshot below:
Marking a version as obsolete signifies that the developers behind the PHP language will no longer issue security updates for this particular version of PHP. As such, it is best to migrate away from obsolete versions of PHP as quickly as possible. That said, older versions of PHP are still made available in order to provide backward compatibility while website owners migrate to newer PHP versions.
Conclusion
By quickly adopting every new version of PHP that is released, our hosting platform aims to provide support for the latest versions of all popular content management systems right out of the box. At the same time, older versions of PHP that no longer receive security updates are gradually phased out in an effort to maintain a high-security level across our entire shared hosting platform. And should you ever find yourself in a position where you need to use a PHP version that we no longer officially support, you can always get a VPS package and host your website there.