lets do some magic for wamp and xampp
you may face the problem sometime where you need to run more than one server on your machine, your own local computer or a server in the network. e.g In my case I was using an old version of xampp which was configured with php 5.2 and i need that so that i can work with old code and old joomla version but then with the release of joomla 3.0 and some other latest cms softwares I realise that I need to update my php, mysql and apache to run with latest cms softwares. now the thing was that If I update my xampp i will got the problems with the old website which are by comparison more than 100 and some of them are on going constant work and lots of work on them is being done and needed if i update the php to latest version. so i was thinking for some work around. I was discussion with some of my friends and one of them give me a suggestion which was pretty wild but a good one. his approach was to use two xampp on the same machine and change the folder name whenever you want to use any one of them. it was good but not an ideal solution which I needed since it was difficult to switch between both version all the time and keep track of thing and specially when you are required to work on two apps at the same time and its difficult for you to work on them same time. e.g working on a joomla 1.0 version and joomla 3.0 version at the same time.
I did some research and find out that wamp can be used with xampp as suggested by another friend of mine who is also a developer and really good one too 🙂
While i was searching on Internet I find the whole information in pieces or not that much great which can easily help out a newbie so I decided to give a shot my self since i also know lot more about xampp and it did not take that much to understand wamp as well plus I got some help from other tutorials as well so after reading like 5 – 6 different links I was finally able to make every thing as I want like accessing two different server on the same computer along with two database management system engines , means two mysql instance running on the same computer which so far no one covered on the internet strangely enough.
So how did I do that lets start here.
I am going to write everything in easy steps here so that you can follow them here easily. Here we assume that xampp is already installed on your machine and its working totally fine and great and you are going to install wamp on the same machine now. I will cover the xampp later if some one ask for it
Step 1 : Close Xampp
first of all to reduce any big problem or confusion kill the xampp for now. if you installed it as services then you need to stop the services as well which can be done from xampp manager or from service settings on windows which will be covered later and linked from here if needed.
Step 2 Install wamp
Install wamp with default settings and options and make it in c directory or wherever you want to install it.(we are assuming it with C for our installation)
Step 3 wamp test run
localhost” in the browser url bar and enter. You should be looking at the the wamp interface just like the one below.
Step 4 do the magic trick for wamp and xampp
basically the trick is to change the port for the wamp apache server and mysql , by default apache listen on port 80 for browsers and mysql listen for port 3306
you need to change the port number for apache. now this thing requires two small changes in a file which is http.conf
this file is on two locations in wamp. one in apache location “C:\wamp\bin\apache\apache*.*.**\conf” where stars are basically the version number. open the file in any editor or notepad and search for this “Listen 80” and change it with “Listen 9090” that means now your server will listen on port number 9090 instead of default port.
the another line is also in the same file just search for this line “ServerName localhost:80” and replace it with “ServerName localhost:9090”
Step 5 change the port for mysql
now this is the second most important part. if you don’t do this you will be accessing the xampp mysql interface and engine which will make you confuse if you don’t know about it because then you will be thinking of adding your scripts in wamp so technically all the databases should be in the wamp as well but in reality the xampp server will take preference if xampp is already running and port is used from the xampp mysql. The wamp mysql will not start entirely and you will also get no problem with that because using the url “localhost/phpmyadmin/” will show the xampp phpmyadmin so to tackle this problem you have to change the mysql port to another number.
To do that you have to go the mysql location which is in my machine is like this “C:\wamp\bin\mysql\mysql5.5.24”. open the file “my.ini” and find the line
port = 3306 and replace it with port = 3307
this will enable your wamp mysql to access along with xampp mysql due to different port address.
last part is to access the wamp mysql from wamp phpmyadmin interface. whenever you try to access phpmyadmin you will be seeing the xampp server or the one which is started first
to tackle that problem we need to make a small change in another area which is phpmyadmin interface code.
to do that go the location “C:\wamp\apps\phpmyadmin3.5.1” now phpmyadmin3.5.1 may be different according to your version but the things will be pretty much the same so to fix that problem find the file “config.inc.php”
find these two lines
$cfg[‘Servers’][$i][‘verbose’] = ‘localhost:3306’
;$cfg[‘Servers’][$i][‘host’] = ‘localhost:3306’;
and replace them with
$cfg[‘Servers’][$i][‘verbose’] = ‘localhost:3307’;
$cfg[‘Servers’][$i][‘host’] = ‘localhost:3307’;
It is possible that you see these lines below
$cfg[‘Servers’][$i][‘verbose’] = ‘localhost’;
$cfg[‘Servers’][$i][‘host’] = ‘localhost’;
so still replace them with lines below
$cfg[‘Servers’][$i][‘verbose’] = ‘localhost:3307’;
$cfg[‘Servers’][$i][‘host’] = ‘localhost:3307’;
now when you access the phpmyadmin with wamp you will be accessing the wamp mysql engine
e.g if now we use the following url “localhost:9090/phpmyadmin/” you will access the wamp mysql along with wamp server
to access wamp server use “localhost:9090/”
and for database connection string you have to use localhost:3307 for all your script from wordpress, joomla to magento
lastly if you are still having any problem you can contact us any time.