1. Home
  2. Technical
  3. PHP
  4. How to change PHP version on the web server

How to change PHP version on the web server

Changing the PHP version on the server takes 3 minutes. During this time, any changes made will not be visible on the page.
Since the web browser keeps the connection to the web server open for a certain period of time, the PHP process with the previous PHP version is also in use for that long. It is recommended to close and reopen the web page to start a new PHP process on the server with the already changed PHP version.

How to change the PHP version for the main domain

To change the PHP version on your server, open Webhosting  from the top menu, and then, under the Webserver section on the left menu, select Main domain settings. On the opened page, find the modify button.

At the bottom of the page, there is a dropdown menu through which you can choose between different PHP versions. Next, select the desired version and click the Save changes button to apply the selection.

change php version on virtual server

How to change the PHP version for a subdomain

To change the PHP version for a subdomain, go to Webhosting, then select Webserver from the left menu. Then click on Subdomains. On the opened page, find the subdomain for which you want to change the PHP version and press the modify button.

At the bottom of the page, there is a dropdown menu where you can choose between different PHP versions. Select the desired version and save by pressing the Save changes button.

Testing the PHP version in a browser

The functionality of the application with different PHP versions can be tested in your browser. Testing is possible both on the main domain and on various subdomains. To do this, locate the button Test PHP versions in Your browser. You can find it on the main domain settings page as well as on the subdomains page.

Through this button, a test page opens, featuring a selection of various PHP versions in its header. By choosing a version from the drop-down menu, the page in the browser is displayed as it would appear if the PHP on the web server were changed to the selected version. This way, you can determine which versions the page is compatible with and which ones it is not. The testing process does not affect the normal operation of the website.

Updated on 5. Sep 2024
Was this article helpful?

Related Articles