There are times when your PHP websites rely on functions/features that are available only in some specific versions of PHP. To host such applications on one web server, you will need to run different PHP versions side by side.

Running multiple PHP versions simultaneously will also help you to test the features of the newest release of PHP before deploying it to live websites. The following tutorial will assist you in running multiple PHP versions in parallel on a single web server.
IMPORTANT - Once you configure multiple versions of PHP in IIS, you’ll have to manage PHP websites from IIS only. 
Any single change from WebsitePanel will overwrite the all the changes you have made to specific website.

Download the new PHP version

With Windows full VPS configuration, you will get the PHP 5.x version pre-installed.

  1. To use a different version, download your choice of PHP version (non-thread safe) from PHP.net

  2. Extract the PHP folder and place it under C:\Program Files (x86)\PHP so that you will have different PHP versions in their folders.

Register a new PHP version in IIS

  1. Open Internet Information Service Manager ( Start >> Run >> type inetmgr and hit enter).

  2. From the Connections pane, select the server name (or specific website name). Under the Features view, locate and double-click PHP Manager.



  3. Under PHP Setup, click on the Register new PHP version link. Browse the new PHP folder path up to the php-cgi.exe file and click on Open. For example, (C:\Program Files\PHP\php-8.3.24\ php-cgi.exe).



Change the new PHP version for a website in IIS

  1. Open Internet Information Service Manager ( Start >> Run >> type inetmgr and hit enter).

  2. From the Connections pane, expand the Sites and select your choice of website. Under the Features view, locate and double-click PHP Manager.

  3. Under PHP Setup, click on the Change PHP version link. Select the PHP version from the dropdown and click OK.



  4. To verify if your website is using the new PHP version, click on the Check phpinfo() link.

Conclusion:

Running multiple PHP versions on a Windows VPS allows you to host and test websites that rely on different PHP features without conflicts. By carefully downloading, registering, and managing each PHP version in IIS, you can ensure that your websites run smoothly and remain compatible with their respective PHP requirements. Always remember to manage your PHP settings through IIS to avoid overwriting configurations from WebsitePanel.

Was this answer helpful? 2 Users Found This Useful (72 Votes)