Wamp and xampp on same machine

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 10:39:28

问题


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.


回答1:


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);
    



回答2:


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.




回答3:


The chances are that they are both trying to run on the same port via localhost. I think it will be difficult to run both at the same time, there's a much better way to this using a tool called "Vagrant".

Vagrant allows you to start up a virtual host that you have full control over, including PHP version. You can see more information about Vagrant at http://www.vagrantup.com/. This tutorial is what helped me get set up and understand how it works: http://code.tutsplus.com/tutorials/vagrant-what-why-and-how--net-26500.

Good luck!




回答4:


If you want to run both XAMPP and WAMP together on the same machine but access only one of the servers at a time then you could go ahead installing both of them one after another. But, keep in mind that before installing the other server you have to completely stop all the services running from the XAMPP or WAMP control panel then quit the application. After this step you can go ahead installing the other server without changing any configurations or port numbers. This is because in this case we assumed that only one of the servers would be accessed at a time. Hence, before launching the other server one has to completely quit the application that is running currently by stopping all of it's services. If skype is installed then one has to change the default incoming connection ports to other than port 80 and 443.

If you messed up changing ports and config files then you could end up with the following error while trying to access phpmyadmin from XAMPP control panel:

    **mysql said: Cannot connect: invalid settings. xampp**

note: while launching the servers , run it as administrator else some services will not start properly.

I TRIED INSTALLING BOTH XAMPP AND WAMP ON WINDOWS 10 AS SUCH AS POINTED BY MANY THREADS I CHANGED THE DEFAULT PORTS FOR MYSQL & APACHE XAMPP AS IT WOULD CONFLICT WITH WAMP ALREADY INSTALLED ONLY ENDING UP UNABLE TO ACCESS PHPMYADMIN FROM XAMPP CONTROL PANEL. THEN REINSTALLED XAMPP WITHOUT CHANGING ANY CONFIGS OR PORTS. STOP THE WAMP SERVICES, QUIT THE APP AND THEN LAUNCH PHPMYADMIN FROM XAMPP CONTROL PANEL. AT LAST IT WORKED!. THE PROCESS LOOKS SHORT THOUGH WHEN IN REALITY IT TOOK ME COUNTLESS HOURS AND PAIN RESEARCHING ON THE WEB AND TESTING FOR A POSSIBLE SOLUTION UNTILL I CAME UP WITH THIS.

Hopes, this quick tips and guides would be helpful.




回答5:


I have two working together, first was wamp. So xampp has to be changed at:

httpd.conf : 
    Listen 8080
    ServerName localhost:8080

httpd-ssl.conf : 
    Listen 4433
    <VirtualHost _default_:4433>www.example.com:4433

By the way, I realised so xampp has much better, mean faster, refreshing time.



来源:https://stackoverflow.com/questions/24639237/wamp-and-xampp-on-same-machine

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!