How to run multiple PHP version with XAMPP on windows Side By Side

Some time we are in a situation where we badly need another PHP version to check our projects in local machine. We have some solutions too for this like Vagrant or Docker which provides us virtual environment. But for some one who heard it first time or in a hurry what will be the solution then?

Let see how we can quickly do it in our local machine in out known environment. I am going to show it for Windows user. Let assume i have a xampp setup of PHP 7.0 but i suddenly in need for PHP 5.6.

  • Let download a older version of xampp from here
  • STOP all apache and mysql service from XAMPP control panel.
  • Install it in xampp_5.6 directory NOT xampp because we already have installed xampp with PHP7.0
  • We have to change the default apache port so that we can run two apache at a time in different port
    • Open xampp_5.6\apache\conf\httpd.conf file in text editor and find Listen 80 and replace with Listen 5656 OR any number you like, Also replace ServerName localhost:80 with ServerName localhost:5656. Make sure that both number are same.
  • We also need to change the SSL port
    • Open xampp_5.6\apache\conf\extra\httpd-ssl.conf file in text editor and find Listen 443 and replace with Listen 444
  • Now we need to change MySql port
    • Open xampp_5.6\mysql\bin\my.ini file in text editor and find 3306 and replace with

Now run apache and mysql from xampp control panel in xampp_5.6 And we have two setup with two different PHP version.

Please Post Your Comments

Your email address will not be published. Required fields are marked *