Skip to content
Advertisement

Keep XAMPP & Install WAMP

I am using Windows 7 and I have XAMPP installed. In Git Bash when I type php -v I get PHP 5.6.15.

I need newer version of PHP because I am using Composer and I am unable to install packages that require PHP 7.1.

I know that one way to solve this is to backup projects, uninstall the current XAMPP and install the latest one (with PHP 7.1)… but I would like to avoid this (if possible) because there are a lot of project files in C:xampphtdocs and many MySQL databases…

So, I am thinking about keeping this XAMPP and installing WAMP with the latest version of PHP, but I have a few short questions.

PLEASE NOTE THAT I WILL NOT USE THEM AT THE SAME TIME – I don’t plan to start Apache from both XAMPP and WAMP at the same time, I just need to be able to run some of my projects when needed… if it’s an older project from XAMPP directory that requires PHP 5.6 – then I’ll start XAMPP and use its Apache/MySQL. If I need to create a new project that requires PHP 7.1 – then I’ll stop Apache/MySQL from XAMPP and start WAMP…

QUESTIONS:

1) Will this work at all? Is there any reason why I should avoid doing this? (keep XAMPP and install WAMP)?

2) If I keep my XAMPP and install WAMP with, let’s say, PHP 7.2 – which PHP version will run on my computer, 5.6 or 7.2? In Git Bash when I type php -v – which version will be displayed? Which version will be used by Composer?

Advertisement

Answer

I was facing this problem I have Xampp with the latest PHP version i.e 8.0 and I need php5.6 for one of projects so I installed the WAMP in a separate drive and XAMPP work with its default port 80 for PHP and 3306 for MySQL. So I configured the Wampp of a separate directory and different PHP and MySQL versions.

I also change the default port from of in WAMP that is 80 to 8080 for apache and MySQL default port from 3306 to 3307 for MYSAL so URL at local will be something like below: http://localhost:8080/ http://localhost:8080/phpmyadmin/index.php

But after this case, I face it while trying to access the project folder on localhost:8080/project_name it threw me the error i.e “No connection could be made because the target machine actively refused it.”

To resolve this you need to check the MySQL connectivity please check below.

define('DB_HOST', 'localhost:3307');
define('DB_USER', 'root');
define('DB_PASSWORD', '');    
define('DB_DATABASE', 'databasename');
$connection=mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or die(mysql_error());
mysql_select_db(DB_DATABASE,$connection);
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement