Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wamp and xampp on same machine

Tags:

apache

xampp

wamp

I use wamp2.2 for all the time, but i had to install xamp1.6.8 cause i've got to work with project created for old php version. Xamp installation goes fine but when i run it i cant get localhost site. Ive got blank page with favicon of wamp and comunicate that site is unavaible. I know that this is configuration case. Anybody know how to fix this?

I want to run only one of them at once, and i have configured some virtualhosts for wamp they dont have to be accesible while xamp is running i need xamp only for one project.

like image 920
user3506641 Avatar asked Jul 08 '14 18:07

user3506641


People also ask

Is WampServer same as XAMPP?

XAMPP and WampServer are both free packages of WAMP, with additional applications/tools, put together by different people. Their differences are in the format/structure of the package, the configurations, and the included management applications.

Can I have two versions of XAMPP?

As two different versions of XAMPP cannot run on the same port, we need to change to the port. Steps to change the port for the XAMPP1_8_2: Open the file HTTP CONF file > change the port from the 80 to 8080. After changing the port click on save and exit.


2 Answers

for run xampp and wamp in same computer you can use this tutorial from arasjoomla website: http://arasjoomla.ir/joomla-tutorial/how-to-run-xampp-and-wamp-on-same-computer for example we used wamp with default port and setting and set changed in xampp:

  1. Change xampp apache port 80 to example 8080 in httpd.conf from directory C:\xampp\apache\conf
  2. In my.ini from C:\xampp\mysql\bin change port=3306 to port=3307
  3. In config.inc.php from C:\xampp\phpMyAdmin after this code:

    $cfg['Servers'][$i]['AllowNoPassword'] = true;

    add this code:

    $cfg['Servers'][$i]['port'] = '3307';

  4. restart xampp now we cab use xampp and wamp for example use this code in xampp port 3307 for connection database:

    $servername = "localhost";
    $username = "root";
    $password = "";
    $dbname = "my_db";
    $port = '3307';
    
    $conn = mysqli_connect($servername, $username, $password, $dbname,$port);
    if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
    }
    
    $sql = "SELECT id, name FROM users";
    $result = mysqli_query($conn, $sql);
    
    if (mysqli_num_rows($result) > 0) {
       while($row = mysqli_fetch_assoc($result)) {
        echo "id: " . $row["id"]. " - Name: " . $row["name"]. "<br>";
       }
     } else 
         echo "0 results";
    
    mysqli_close($conn);
    
like image 110
saber Avatar answered Sep 19 '22 08:09

saber


WAMP and XAMPP are basically the same thing i.e. Apache MySQL and PHP so if one is running it's Apache will have captured port 80, so the second one wont be able to get to port 80, ditto one's MySQL server will have captured port 3306 so the others wont run.

Why do you need to install XAMPP to get an old version of PHP running, WAMPServer is designed to allow you to switch between multiple versions of Apache/MySQL and PHP fairly easily.

But now you have done it, just make sure that the Apache and MySQL services from XAMPP are set to start manually and also Wampservers [wampapache] and [wampmysqld] services as well. then just run only one of them at any one time.

like image 44
RiggsFolly Avatar answered Sep 20 '22 08:09

RiggsFolly