Multiple PHP Versions For Different VirtualHosts
Posted by: ezxcess (1.128.108.---)
Date: May 22, 2019 02:37AM

I am running Wamp 3.1.9 on a Windows Pro. This is my first time using WAMP as I previous used Ubuntu but circumstances require the I run this in Windows because there are Windows applications that I need to use.

Anyway, I was wondering if there is any way for me to configure different PHP versions on a VirtualHost level. I am able to do this in Apache2 in Ubuntu but not sure if WAMP has similar methods. Its a bit tedious to change the PHP version manually as I have multiple sites running different versions of PHP, eg. 5.6, 7.2, etc...

Hope someone can help me and thank you for any help.

Regards,

Options: ReplyQuote
Re: Multiple PHP Versions For Different VirtualHosts
Posted by: Otomatic (Moderator)
Date: May 22, 2019 08:50AM

Hi,

> if there is any way for me to configure different PHP versions on a VirtualHost level
No.

But you can change PHP version "on the fly".
With a web page of a local site loaded in a browser, you can do, with the Wampmanager menu:
Left-click -> PHP -> Version -> Choose the desired version
Then, reload the web page (Ctrl-F5) and the new version of PHP will be used.

I searched in the Apache documentation but I didn't find which directive allows to change the PHP version based on the VirtualHost launched.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 2 time(s). Last edit at 05/22/2019 02:13PM by Otomatic.

Options: ReplyQuote
Re: Multiple PHP Versions For Different VirtualHosts
Posted by: wasedavo (---.hsd1.ut.comcast.net)
Date: July 22, 2020 11:11PM

I'm working on different websites where one uses PHP 5 and another uses 7, and sometimes I need both open at the same time.

Is there no way to have both versions of PHP running on Windows 10, and then have WAMP use one or the other for the different versions? I mean, without me having to manually change which version of PHP WAMP is running.

I've seen this done on Linux with one http server and multiple installed versions of PHP (5 and 7), where each site would be set to use whichever version it needed, but I'm having trouble figuring out how to do this with WAMP on my Windows 10 Pro.

Options: ReplyQuote
Re: Multiple PHP Versions For Different VirtualHosts
Posted by: Otomatic (Moderator)
Date: July 23, 2020 09:43AM

Hi,

This question was already answered more than a year ago. The answer has not changed and is still: it is not possible with Wampserver.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.