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.

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.3 32 bit - Apache 2.4.46a - PHP 7.4.11…5.6.40 - MySQL 5.7.31 - MariaDB 10.5.6
Wampserver 3.2.3 64 bit - Apache 2.4.46a - PHP 7.4.11…5.6.40 - MySQL 5.7.31/8.0.21 - MariaDB 10.5.6
PhPMyadmin 5.0.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »



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.

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.3 32 bit - Apache 2.4.46a - PHP 7.4.11…5.6.40 - MySQL 5.7.31 - MariaDB 10.5.6
Wampserver 3.2.3 64 bit - Apache 2.4.46a - PHP 7.4.11…5.6.40 - MySQL 5.7.31/8.0.21 - MariaDB 10.5.6
PhPMyadmin 5.0.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote


Sorry, only registered users may post in this forum.