Is there way to use two PHP versions in XAMPP? -
we running xampp php 7.0 because our new products requires php 7.
but there old project use functions mysql_connect
, etc. removed in php 7.0.
so there way change php versions in xampp.
note : please don't suggest upgrade old project compatible new versions because not in position because decisions can't developer(just employee).
you can download whatever versions of php need , place them own directories, e.g.
c:\php5\
c:\php7\
all need tell web server (apache) version of php use, loading appropriate module. in apache can finding file httpd.conf
, editing appropriate line:
loadmodule php7_module c:\php7\libphp7.so
you'll have figure out correct paths of course - illustration.
save httpd.conf
, restart server. note, if don't restart it, changes won't take effect.
there's no gui switch able this, need edit .conf
file , restart apache. doing takes couple of seconds , comment out version "switching" takes couple of keystrokes, e.g.
use php 5:
loadmodule php5_module c:\php5\libphp5.so #loadmodule php7_module c:\php7\libphp7.so
use php 7:
#loadmodule php5_module c:\php5\libphp5.so loadmodule php7_module c:\php7\libphp7.so
you not need multiple versions of xampp, or dual boot, or use different machine, or of other "solutions" have suggested convoluted workarounds. op wants use xampp , tell version of php use. quickest , efficient way of doing it, , requires 1 xampp installation.
Comments
Post a Comment