r/PHPhelp • u/KaoruIsObnoxious • Jan 20 '26
XAMPP two php versions on same port
I've tried searching for the answer but nothing clear comes up.
Client has a XAMPP and i cannot change that.
They need to host a new site but it's a newer php than the other projects are running on.
I'd like to know if it's possible to run different PHP versions on different vhosts, while sharing the same port, only difference would be the ServerAlias.
Most solutions I've seen to this just say to use a different port, but this is not an option currently and I'd need to use the port 80 for all sites.
4
Upvotes
4
u/Mobile_Syllabub_8446 Jan 20 '26
They likely meant an internal port not an external port, but it's even easier using FPM
https://stackoverflow.com/questions/42696856/running-two-php-versions-on-the-same-server-using-apache
6
u/Moceannl Jan 20 '26
Xampp is for development... Just write a big e-mail so you have on paper that it's not meant for production/real data/real traffic ...
3
u/colshrapnel Jan 20 '26
Your question is SUPER confusing. "Same port" is one thing, different vhosts is another. And even after that you are making a u-turn and saying "no vhosts, just ServerAlias". And for the latter, it's quite unclear how it's even supposed to work.
I would assume we are talking of vhosts here, as the only sensible option. I can think of two possible solutions for having different PHP versions for different vhosts
1
u/colshrapnel Jan 20 '26
Another take: use Rector to downgrade PHP version. Problem solved :D
1
u/MajorRageCodes Jan 20 '26
They nornally use XAMPP because it is easily deployable from software center, thats if you are using a client to server windows environment.
1
u/pro9_developer Jan 21 '26
Hi, I came to this solution to run two php versions but i did not try it.
Please check here - https://stackoverflow.com/questions/45790160/is-there-way-to-use-two-php-versions-in-xampp
1
u/the-fluent-developer Jan 22 '26
Have you considered putting a proxy in front?
0
u/[deleted] Jan 21 '26
[deleted] — view deleted comment